Question: write a c++ program. Your brother / sister is currently taking a geometry class. They would like you to create a program that they can

write a c++ program.

Your brother / sister is currently taking a geometry class. They would like you to create a program that they can use to verify calculations. Specifically, they want the program to calculate the area of a square, rectangle, parallelogram, circle, and triangle. Write a program that enters a numeric code that represents the type of area calculation to perform. A code of 1 represents a square, 2 is a rectangle, 3 is a parallelogram, 4 is a circle, and 5 is a triangle. The program will also need to enter the dimensions of the shape. The program should calculate the area of the shape. It should also display the name of the shape (Square, Rectangle, and so on) and the area. If an invalid code is entered, display an error message and the bad code entered. A nested if / else structure should be used to handle the 6 possible entry types.

a. Execute the program four times, using the following data:

(1) A square side measurement of 4,

(2) A rectangle length of 5 and width of 3,

(3) A parallelogram base of 3 and height of 4,

(4) An invalid shape with a number other than 1-5.

b. Save the program aslab3ifsh.cpp.

c. For this program, hand in:

A copy of the source code for each of the programs.

A copy of the screen print for the output for each of the program runs

(Remember you will run this program 4 times and produce output for each run.)

write in if and else

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!