PROGRAM 3
Write a menu driven program to calculate and display area of different geometrical
figures. Accept the choice from the user and perform the following operations:
MENU:
CHOICE OPERATION
1. Area of Rectangle
2. Area of Square
3. Area of Circle
4. EXIT
ch = None
while ch != 4:
print("""\nFrom the given geometrical figures, choose any one from the following:
MENU:
CHOICE OPERATION
1.............Area of rectangle
2.............Area of square
3.............Area of circle
4.............Exit""")
ch = int(input("Enter your choice as 1, 2, 3, or 4 only: "))
if ch == 1:
l = int(input("Enter the length of the rectangle: "))
b = int(input("Enter the breadth of the rectangle: "))
A1 = l*b
print("The area of the rectangle is:", A1)
elif ch == 2:
s = int(input("Enter the side of the square: "))
A2 = s**2
print("The area of the square is:", A2)
elif ch == 3:
r = int(input("Enter the radius of the circle: "))
A3 = 3.14*(r**2)
print("The area of the circle is:", A3)
elif ch == 4:
print("Thank you for using our program!")
else:
print("ERROR_Enter you choice as 1, 2, 3, or 4 only!")
OUTPUT