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 as lab3ifsh.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.)

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_2

Step: 3

blur-text-image_3

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

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

7. Explain how an employee could reduce stress at work.

Answered: 1 week ago

Question

(1 point) Calculate 3 sin x cos x dx.

Answered: 1 week ago