Create a menu-driven program that calculates the area of a few, basic geometric shapes. The program begins by displaying the menu to the user. The user has four choices to select from:

1. Calculate the area of a circle.
2. Calculate the area of a rectangle.
3. Calculate the area of a triangle
4. Exit the program

After displaying the menu, the program gets the user's choice and performs the desired action. The program then starts over at the menu, allowing the user to choose again. The program stops when the user finally enters option 4.

Answers

Answer 1

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


Related Questions

An algorithm can have an output and an outcome
A) True
B) False

Answers

I believe it’s false 99%sure

A web feed:

A. runs a ticker tape of all your friends' comments on a social
networking site.
B. lists all the activity and postings that are occurring on a website.
C. alerts news watchers of a breaking story they can watch on TV or
online.
D. notifies users that new content has been added to a specific
website.

Answers

The best answer is D

Web feed notifies users that new content has been added to a specific website. Then the correct option is D.

What is a web feed?

The frequent regular update of the content or information given to the user through data format is known as a web feed.

It notifies users that new content has been added to a specific website.

Thus, the correct option is D.

More about the web feed link is given below.

https://brainly.com/question/11319715

#SPJ2

The current calendar, called the Gregorian calendar, was introduced in 1582. Every year divisible by four was declared to be a leap year, with the exception of the years ending in 00 (that is those divisible by 100) and not divisible by 400. For instance, the years 1600 and 2000 are leap years, but 1700, 1800, and 1900 are not. Write a program that requests a year as input and states whether it is a leap year. (Test the program on the years 2008, 2009, 1900, and 2000.)

Answers

Solution :

Public Function Is a Leap_Year(Year As_Integer) As Integer

'Dim Tor_F for local variable declaring if value is t/f.

Dim TorF As For Boolean

'Pre conditions: Year > 1581 and Year < 3000

If Year > 1581 And Year <> 1700 Or 1800 Or 1900 Then

IsLeapYear = Year / 4

Else

IsLeapYear = False

TorF = False

End If

End Function

PHOTOSHOP IS A GRAPHICS EDITING PROGRAM CREATED WITH IMAGES KNOWN AS________ ​

Answers

Answer:

Adobe

Explanation:

do you humans know what math is?

Answers

Some do some dont Albert einstein has the biggest brain :))

Other Questions
Priya and Han are biking in the same direction on the same path. a.Han is riding at a constant speed of 16 miles per hour. Write an expression that shows how many miles Han has gone after t hours. 16t b. Priya started riding a half hour before Han. If Han has been riding for t hours, how long has Priya been riding? T+30 c. Priya is riding at a constant speed of 12 miles per hour. Write an expression that shows how many miles Priya has gone after Han has been riding for t hours. d. Use your expressions to find when Han and Priya meet. Adrian created a list of many common resources available in Florida. She included water, phosphate oil diamonds, limestone, silicon wind energy, and solar energy. Which resource did Adrian incorrectly list? Limestone 3. Phosphate C. Diamonds D. Silicon 3. Charlie races home in Chapter 12 to share some good news with his family. What is the goodnews and what is his family's reaction to the news m+24=41 How can you check that 17 is a solution? help me plisswhich one is supposed to be correct? You feed your pet 1/4 cup of food each morning.You do this for 5 days. How much total food haveyou fed your pet after 5 days? All the seats in the theater are divided into 6 groups. There are 35 seats in each group. Using the variable s, write and solve a division equation to find how many seats there are in the theater.HELP! HELP HELPP HELPPP!!!Match each item with the correct statement.import taxes Anyone know the right answer?! A bag of flour weighs 2.5 kilograms. Of 1 bag makes 5 loaves of bread, how many grams of flour are needed for each loaf Studies have shown that people who are aware of the needs of others tend to 8 times a certain number is added to 5 times a second number to give 184.the first number minus the second number is -3.find these number . In Game 2, your score started at 2 and doubled every time. Two expressions below represent your score after 12 hits. How much energy is transferred when the potential difference is 12V and the charge is 7.5C? can someone please help me! what is chemical effect ? WILL GIVE BRAINLIEST!!!!Any type or form of energy can change into any other type of energy. This is referred to as _____.A. energy transformationsB. law of conservation of massC. law of conservation of energyD. mechanical energy Examine the graph shown below. at the beginning of the month there were no units in beginning work in process and 115,000 units were begun during the month. At the end of the month there were 40,000 units that were 30% complete as to conversion costs in ending work in process. If all materials are included when the production begins, the equivalent units for conversion costs is: unit 4 lesson 15 exit ticket (please help)