Menu

[Solved]Write Function C Language Named Sums Two Input Parameters Array Called Input Doubles Integ Q37023817

Write a function in C language, named sums(), that has two inputparameters; an array, called Input of doubles; and an integer whichis the number of values stored in the array and the 4 outputparameters as stated below. Compute the sum of the positive valuesin the array and the sum of the negative values. Also count thenumber of values in each category. Return these four answersthrough output parameters. Write a main program that reads no morethan 20 real numbers and stores them in an array. Stop readingnumbers when a 0 is entered. Call the sums() function and print theanswers it returns. Also compute and print the average values ofthe positive and negative sets. Align decimal points on numbers

Must also have a function called readData that reads in thearray, printData that echos/prints the array.

SAMPLE INPUT:
-123.45
-234.56
576.1
-9.345
675.2
100
-10
1654.45
765.89
0 (NOT in computation)

SAMPLE OUTPUT:

YourName Program#7 CSCI1110

Input Read:  (echo the input, align by implied decimalpoint)
9999.9999
9999.9999

Statistics:
Desc     Number    Total:      Average:
Positive 99     99999.9999   9999.9999
Negative 99     99999.9999   9999.9999
Overall   99    99999.9999    9999.9999

—-PARTIAL SAMPLE OUTPUT:
Negative   4      -377.3550    -94.3388

Your function call is: sums(input, numOfInput,&sumPos, &sumNeg, &countPos,&countNeg)

Expert Answer


Answer to Write a function in C language, named sums(), that has two input parameters; an array, called Input of doubles; and an i… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *