KEMBAR78
Komal PROGRAM 3 | PDF | Teaching Methods & Materials
0% found this document useful (0 votes)
34 views3 pages

Komal PROGRAM 3

This is the pdf for practical in the domain of Computer Science.

Uploaded by

classykomal902
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views3 pages

Komal PROGRAM 3

This is the pdf for practical in the domain of Computer Science.

Uploaded by

classykomal902
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

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

You might also like