Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started