The module Get data or getdatac is written in C Using a loop

The module Get data (or getdata.c) is written in C. Using a loop it asks the user to input doubles until the user signals that there are no more data or else the array is full.

The module Displayarray (or display.cpp) outputs the contents of an array in a nicely formatted style. Obviously, data must be passed from the caller to this Display function.

Compute sum (or computesum.asm) does what its name says: it sums all the numbers in the set and returns that sum to the caller. The caller decides what to do with the sum: output it, pass it to another function, or whatever. This function is written in X86 assembly and is assembled with an open source assembler. This function does not do any I/O.

Compute arithmetic mean (computemean.c) also does what its name says: compute the mean of the data set and return that number to the caller. The main module passes to this function the sum of the values in the array (already computed by an earlier function) and the number of values in the array (already computed by getdata). This function performs no I/O.

The Sort function (or sort.c) sorts the data. You may borrow a sort function from your data structure course if wish. If you use someone else\'s sort function you should give credit for the use of that function. Any kind of sorting you like is acceptable: heap sort, merge sort, quick sort, or anything else. This function does not perform any I/O.

The Compute harmonic mean function computes the harmonic mean of the set of numbers. This function performs no I/O.

The last function is the median function. This function finds the median number and returns it to the caller. This function does not output anything.

In summary only the functions Main, Getdata, and Display perform I/O.

Sample execution

Welcome to Data Analysis by Cindy Gutierrez

This program will compute certain statistical values.

Please enter floating point data.

After the last number has been entered press Cntl+D

3.0

7.0

4.0

2.0

Cntl+D

Thank you. The data you entered are

3.00000

7.00000

4.00000

2.00000

The following statistics were computed

Sum: 16.00000

Arithmetic mean 4.00000

Median 3.50000

Harmonic mean 3.26214

The sorted data set is:

2.0000

3.0000

4,0000

7.0000

The original data set is

3.00000

7.00000

4.00000

2.00000

Thank you for using this program. Enjoy your statistics.

Data Aealysis: C Get data: C Compute mean: C Compute sum: Asm Sort: C lO Displayarray: C++ Compute median: C++ Compute harmonic mean: C++ The main module is shown at the root of the tree. That module calls all the others one by one. The data, probably an array, are stored in the main module. From the main the data are passed to called modules as needed.

Solution

storeData.c

//store like header files format main.cc

#include<stdio.h>

#include<conio.h>

void main()

{

int arr[100],i,n;

printf(\"Enter the no of Elements:\");

scanf(\"%d\",&n);

printf(\"Enter the Elements:\");

for(i=0;i<n;i++)

{

scanf(\"%d\",&a[i]);

}

}

sort.c

logic

#include \"main.cc\"

for(i=0;i<n;i++)

{

for(j=0;j<n-1;j++)

{

for(a[j]>a[j+1])

{

t=a[j];

a[j]=a[j+1];

a[j+1]=t;

}}}

we are implement all like this

The module Get data (or getdata.c) is written in C. Using a loop it asks the user to input doubles until the user signals that there are no more data or else th
The module Get data (or getdata.c) is written in C. Using a loop it asks the user to input doubles until the user signals that there are no more data or else th
The module Get data (or getdata.c) is written in C. Using a loop it asks the user to input doubles until the user signals that there are no more data or else th

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site