Question: C Programming Assignment 4 While Loops and Switch Due Wednesday, October 4, 2017 Submit .c files for each of the programs described below on Canvas
C Programming Assignment 4 While Loops and Switch Due Wednesday, October 4, 2017 Submit .c files for each of the programs described below on Canvas under Assignments. Observe the usual guidelines regarding the initial comment section, indenting, and so on. In addition, In if-else statements, indent statements to be executed for if or else condition three spaces. Align else or else if with corresponding if. Indent statements within loops. Do not use global variables. 1. Write a program using the switch statement to calculate geometric quantities. Prompt the user to enter a radius. Then present a menu of choices for quantities to be calculated from that radius A Area of a Circle C Circumference of a Circle S Surface Area of a Sphere V Volume of a Sphere Prompt the user to enter the character corresponding to the quantity to be calculated. Use a switch statement to handle the calculations. Use the appropriate equation in each case Allow for inclusion of both upper case and lower case letters and present an error message for an improper choice. Print the quantity calculated with 2 decimal digits. 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 quantity is to be calculated. For example, suppose that a radius is entered and the user specifies that the circumference is to be calculated. After the result is printed the user will be asked if he wants to do another calculation. He might enter Y to continue or N to quit. Include entry of the radius as well as the switch statement in the loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
