Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

10. Is the statement easy to read?

Answered: 1 week ago

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago