Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C + + Program Specifications Create a menu - driven program that calculates and displays the areas of two different objects: squares and circles. The

C++ Program Specifications
Create a menu-driven program that calculates and
displays the areas of two different objects: squares and
circles.
The menu should have the following three choices:
1-- square
2-- circle 3 quit
if the user selects choice 1, the program shall ask
the user for the side length of the square (can be a
decimal number) and shall calculate the area of the
square and output it as shown in the sample run to
the right.
if the user selects choice 2, the program shall ask
the user for the radius of the circle (can be a
decimal number) and shall calculate the area of the
circle and output it as shown in the sample run to
the right. Use 3.14 for the value of pi.
If the user selects choice 3, the program shall quit
after outputting an additional newline.
if the user enters a value for choice that is not in
the range [1,3] then the program shall output an
error message as shown in the sample run to the
right and will then re-display the menu.

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

Lab Manual For Database Development

Authors: Rachelle Reese

1st Custom Edition

1256741736, 978-1256741732

More Books

Students also viewed these Databases questions