Write menu driven program that performs following operations :-
while(True):
print("Select any one option from following: ")
print("\n 1. Area of circle")
print("\n 2. Area of triangle")
print("\n 3. Area of Square")
print("\n 4. Area of Rectangle")
print("\n 5. Simple Interest")
print("\n 6. Exit prom the program")
ch=int(input("Press number between 1 to 5"))
if(ch==1):
print("Find area of circle")
r=float(input("Enter Radius"))
a=3.14*r*r
print("The area of circle is ",a)
elif(ch==2):
print("Find area of triangle")
h=float(input("Enter height"))
b=float(input("Enter base"))
a=(b*h)/2
print("The area of triangle is ",a)
elif(ch==3):
print("Find area of square")
l=float(input("Enter length"))
a=l*l
print("The area of square is ",a)
elif(ch==4):
print("Find area of rectangle")
l=float(input("Enter length"))
b=float(input("Enter base"))
a=l*b
print("The area of rectangle is ",a)
elif(ch==5):
print("Find area of simple interest")
p=float(input("Enter principle amount"))
r=float(input("Enter rate of ineterest"))
n=int(input("Enter number of year"))
si=(p*r*n)/100
print("The simple interest is ",si)
elif(ch==6):
break
else:
print("Wrong choice entered")
break
- find area of circle
- find area of triangle
- find area of square
- find area of rectangle
- find simple interest
while(True):
print("Select any one option from following: ")
print("\n 1. Area of circle")
print("\n 2. Area of triangle")
print("\n 3. Area of Square")
print("\n 4. Area of Rectangle")
print("\n 5. Simple Interest")
print("\n 6. Exit prom the program")
ch=int(input("Press number between 1 to 5"))
if(ch==1):
print("Find area of circle")
r=float(input("Enter Radius"))
a=3.14*r*r
print("The area of circle is ",a)
elif(ch==2):
print("Find area of triangle")
h=float(input("Enter height"))
b=float(input("Enter base"))
a=(b*h)/2
print("The area of triangle is ",a)
elif(ch==3):
print("Find area of square")
l=float(input("Enter length"))
a=l*l
print("The area of square is ",a)
elif(ch==4):
print("Find area of rectangle")
l=float(input("Enter length"))
b=float(input("Enter base"))
a=l*b
print("The area of rectangle is ",a)
elif(ch==5):
print("Find area of simple interest")
p=float(input("Enter principle amount"))
r=float(input("Enter rate of ineterest"))
n=int(input("Enter number of year"))
si=(p*r*n)/100
print("The simple interest is ",si)
elif(ch==6):
break
else:
print("Wrong choice entered")
break