Question: Rewrite this code in C# so that it looks different, but outputs the same thing. Rewrite following code in C# so that it get 10

 Rewrite this code in C# so that it looks different, but

Rewrite this code in C# so that it looks different, but outputs the same thing.

Rewrite following code in C\# so that it get 10 Numbers, check numbers whether they are valid or invalid and it print following items Sum, Mean, Max, Average, Standard deviation, sorted numbers, Median and Variance. Write the C\# console program code to input ten numeric values from a user, and calculate and outputs the sum, min, max, average, and sample standard deviation for the ten values. User input should be validated (for each of the 10 numbers, if not a valid number, prompt and reread repeatedly until a valid number is entered). Formulas: Sum=i=1nXi,Avg=nSum,S=n1i=1n(XiAvg)2=n1i=1nXi2nSum22 Solution: double sum =0.0, sumsquared =0.0,min= double. MaxValue, max= double. MinValue; for (int i=1;imax)max= value; sum += value; sumsquared += Math.Pow ( value, 2); \} double avg = sum / 10.0; double stdev = Math. Sqrt (( sumsquared Math.Pow ( sum, 2) / 10.0) / (10.0 - 1)); Console. Writeline("Sum ={0},Min={1},Max={2},Avg={3},Stdev={4}", sum, min, max,avg, stdev)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!