Question: Code in C++, use return, if/else statements, etc. Beginner/Intermediate C++ knowledge Write a program to calculate the area of several basic geometric shapes. The program
Write a program to calculate the area of several basic geometric shapes. The program first asks the user for a shape(C Circle, R -Rectangle, S Square, and T Triangle). The program then calls one of four user defined functions to calculate the area of the shape and return the answer to the main for printing to the screen. Depending on the shape, the corresponding function's argument(s) is (are) the necessary parameter(s) for area calculation. Therefore, the main should receive the value(s of the parameter(s) from the user before calling any function. The following is a list of parameters for each shape and the expression for its area calculation Shape Circle (C) Square (S) Rectangle (R Radius Side Height Area-3.14159(Radius Area (Side) Area-Width(Height) Width Triangle (T Base Height Area 0.5 (Base)(Height) You must test your program for all shapes. The program should reject request for any other shapes; this option must be tested as well
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
