Question: c++ program Document Description Your PSL document will contain Steps 1-4 for the problem described below Do as much of the PSL work as possible
Document Description Your PSL document will contain Steps 1-4 for the problem described below Do as much of the PSL work as possible before coding. . In PSL step 2, don't forget the constraints on all of your input In PSL step 3, design a flowchart to show the branching and flow of execution. . In PSL step 4, predict the output you should get, given the input data Project Description: Write a program to calculate the area of a circle, rectangle or triangle. The following menu will be output Geometry Calculator 1. 2. 3. 4. Calculate the Area of a Circle Calculate the Area of a Rectangle Calculate the Area of a Triangle Quit Enter your choice (1-4): If the user enters 1, the program should ask for the radius of the circle and then display its area. Use the following formula: area pir2 where pi is declared as a constant, and r is the radius entered at the terminal. If the user enters 2, the program should ask for the length and width of the rectangle and then display the rectangle's area. Use the following formula: area length width where length and width will be input from the terminal If the user enters 3, the program should ask for the length of a triangle's base and its height and then display its area. Use the formula: area base height .5 If the user enters 4, the program should end and say Bye! The program should loop for all inputs until 4 is input. Input Validation: Display an error message if the user enters a number outside the range of 1 through 4 whern selecting an item from the menu. Do not accept negative values for the circle's radius, the rectangle's length or width, or the triangle's base or height. An appropriate message is to be output indicating the invalid data and its type. Error messages should look like: The circle's radius is invalid, or The rectangle's height is invalid or The rectangle's width is invalid or The triangle's base is invalid or The triangle's height is invalid. A switch statement should be used to handle the menu choices
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
