Question: C++ please. Write a program that takes in input the side of a square or radius of a circle followed by the desired option 1
C++ please.
Write 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 cirale) 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 0), If its not correct, the output message should contain the word error
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
