Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ please Use the following syntax to print the final price with two digits after the comma. Cout Cout Decimals must be rounded to the
C++ please
Use the following syntax to print the final price with two digits after the comma.
Cout
Cout
Vrite a program that takes in input the side of a square or radius of a circle followed by the desired option 1 (for square) ,2 (for circle) Enter these values in the input box. The program will output the final area. Formula for computing area: 1. square > side side 2 circle-3.14 radius radius Sample input So, for example you enter the following input in the input box in the input box 3 2 The first input 3 can be either the radius of the circle or side of a square. But the second input 2 implies we have to compute the area of the circle. So, the code should print the area of the circle considering 3 as radius of the circle Sample output for the above input: 28.26 If any other value for option is given (other than 1 or 2) the output should be: Wrong option Check for the correctness of the side or radius (must be greater than O). If it's not correct, the output message should contain the word error Use switch statements to choose the options. Use the following syntax to print tht final price with two digits after the comma (requires library iomanip) Decimals must be rounded to the hundredth place for outputs.
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