Question: Coded in C 1. Write a program using a switch statement to calculate means for a set of random numbers. Seed the random number generator

Coded in C
Coded in C 1. Write a program using a switch statement to

1. Write a program using a switch statement to calculate means for a set of random numbers. Seed the random number generator with time and generate four random integers between the values of 5 and 25. Print the numbers. Create a menu and prompt the user to enter the type of mean to be calculated. The user should enter A for arithmetic mean, H for harmonic mean, or G for geometric mean. The mean type will be the switch variable. The program should allow for entry of upper or lower case characters and should include an error message (default) for entry of an invalid character. Within the chosen case, calculate the mean using the appropriate formula below: arithmetic mean +x. + x + x geometric_mean- *x* x2 * x, *x, Print the mean with two decimal digits within the case or after exiting the switch. When the program is working, modify it using a while or do...while loop so that the program will continue prompting the user to see if another mean is to be calculated. After the chosen mean is printed the user will be asked if he wants to calculate another mean. He might enter Y (or 1) to continue or N (or 0) to quit. Use the same random numbers for each mean calculated

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!