Question: #include Problem 2 . Calculating Area, Circumference of Circle Expand the program you wrote for Problem 1 to include circle circumference calculation. The user of

#include Problem 2. Calculating Area, Circumference of
Circle
Expand the program you wrote for Problem 1 to include circle circumference
calculation. The user of your program first enters a radius as before, but your
program then should prompt the user to pick either an area calculation or
circumference. If the user enters a '1' then calculate area, if the user enters a '2'
then calculate circumference. If the user enters any other number, then print an
invalid user input message with the input number.
Input:
The program will ask the user to enter
The radius of circle (float variables identified as radius).
Then ask user to enter either 1. to calculate Area or 2. to calculate
circumference.
If the user enters any other value an error messages "Invalid user input
message with the input number." must be displayed, and the program ends.
Output:
The output must be formatted as below:
Enter the radius of the circle: 12.5
-Radius entered is: 12.5%
Enter '1' for area or '2' for circunference: }
The area of the circle 1s: 490.05
Enter the radius of the circle: 27
-Radius entered is: 27.e@
Enter '1' for area or '2' for circunference: 2
The circunference of the circle is: 169.64
Enter the radius of the circle: 5.37
-Radius entered is: 5.37
Enter '1' for area or '2' for circunference:,5
Irvalid user input: 5
Topics covered: Basic C, printf/scanf, Expression evaluation (Chapter 1-2).
Test your code before submitting
Remember to compile your code and fix any errors.
Then test it, if it passes all tests, then you can submit by selecting the option "mark
as complete".
Test 1
Test User Choice 1. calculate area
#include
#include Problem 2 . Calculating Area,

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 Programming Questions!