Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

2) Write an interactive program that asks the user to enter the first letter of a geometric shape, and then let your program calculate and

image text in transcribed

2) Write an interactive program that asks the user to enter the first letter of a geometric shape, and then let your program calculate and output the area and perimeter of the chosen shape. For simplicity, let your program deal only with rectangles and circles. Hints: For a rectangle: area = base height, perimeter = 2 * (base + height)) For a circle: area-2, circumference-2r, where r is the radius. Your program must display an error message to indicate that the user entered a character other than R', 'r', 'C' or 'c' Use the switch statement to decide which formulas to be used

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions