Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CMPE 1 3 0 0 - ICA 3 In this assignment, you will write a program that will calculate the area of a circle or
CMPE ICA
In this assignment, you will write a program that will calculate the area of a circle or the volume of a sphere. The program will use a combination of ifelse constructs to perform all of the decisions. Your solution will perform the following operations:
Display a title for the program consisting of your name and the assignment number.
Input the radius as a double value checking for a valid number. If an invalid number or a negative radius value was entered display an error message, pause, then exit the program after the user presses any key. If a valid radius was entered, proceed to the steps below.
Input from the user the desired calculation as a string. Convert the string to lower case then test for it containing either "area" or "volume". If the string entered was valid, perform the desired calculation. If an invalid string was entered display an error message, pause, then exit the program after the user presses any key.
Perform and display the desired calculation. Use the format one decimal place shown in the examples below.
Pause the program to allow the user to view the output.
When writing your program, use the format of the output shown below. Include all blanks lines and the line of dashes. Your program must be commented and use descriptive variable names before it will be accepted. Write the pseudocode first and show it to your instructor. You'll then copy the pseudocode statements and make them comments to your different program blocks.
JD Silver Assignment
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