Answered step by step
Verified Expert Solution
Link Copied!

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
Decimals must be rounded to the hundredth place for outputs. image text in transcribed
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)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions