Design an algorithm to read a value from the keyboard which represents the name of a shape. Allowed shapes are circle, parallelogram, and triangle, any other shape name should result in an error message being displayed. If the user enters parallelogram, then they should be asked to indicated between rectangle or square. For triangles, only right-angled triangles are allowed.
For each shape the area of the is to be calculated and displayed so the program should prompt the user for any additional information needed to calculate the area based on the shape. The calculated area along with the input from the user should be displayed.
Draw the flowchart and write the pseudocode for the algorithm. Implement the algorithm in C++.
Comments
Leave a comment