Project 3-4: Area Calculator
Create a program that calculates the area of various shapes.
Console (valid menu item 1)
AREA CALCULATOR
1. Circle
2. Square
3. Rectangle
Menu item:
CIRCLE
Radius: 40
Area: 5026.54
Bye!
Console (valid menu item 3)
AREA CALCULATOR
1. Circle
2. Square
3. Rectangle
Menu item: 3
RECTANGLE
Height: 100
Width: 20
Area: 200
Bye!
Console (invalid menu item)
AREA CALCULATOR
1. Circle
2. Square
3. Rectangle
Menu item: 4
Invalid menu item!
Specifications
Use a switch statement to determine which shape was selected by the user.
Here are the formulas you can use to calculate the areas of the shapes:
- circle_area = 3.14159 * radius^2
- square_area = height^2
- rectangle_area = height * width
Assume that the user will enter valid data for the radius, length, and width.