Answer:
todo = True
[tex]print("Menu\n\ 1 - Area\ of\ Circle\n\ 2 - Area\ of\ Rectangle\n\ 3 - Area\ of Triangle\n\ 4 - Exit")[/tex]
menu = int(input("Select Menu: "))
while(todo):
if menu == 1:
radius = float(input("Radius: "))
print("Area: "+str(3.142 * radius * radius))
todo = True
menu = int(input("Select Menu: "))
elif menu == 2:
length = float(input("Length: "))
width = float(input("Width: "))
print("Area: "+str(length * width))
todo = True
menu = int(input("Select Menu: "))
elif menu == 3:
bs = float(input("Base: "))
hght = float(input("Height: "))
print("Area: "+str(bs * hght/2))
todo = True
menu = int(input("Select Menu: "))
elif menu == 4:
todo = False
else:
print("Invalid menu selected")
todo = True
menu = int(input("Select Menu: "))
Explanation:
The program was written in Python and the explanation goes thus:
See attachment for explanation where I used comment to explain the program