1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kompoz [17]
3 years ago
7

Create a menu-driven program that calculates the area of a few, basic geometric shapes. The program begins by displaying the men

u 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.
Computers and Technology
1 answer:
lana66690 [7]3 years ago
6 0

Answer:

todo = True

print("Menu\n\  1 - Area\ of\ Circle\n\ 2 - Area\ of\ Rectangle\n\ 3 - Area\ of Triangle\n\ 4 - Exit")

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

Download txt
You might be interested in
¿Cómo es la onda percibida por un osciloscopio cuando hablamos de sonido? ¿Qué parámetros podemos observar en ella?
frozen [14]

Answer:

Las ondas de sonido, que es una onda longitudinal, son producidas por la vibración de un objeto de tal manera que (la onda de sonido requiere un medio de viaje, líquido sólido o gas) la dirección del sonido es la misma que la dirección de la vibración y como la el ancho de la vibración (hacia adelante y hacia atrás) aumenta, la amplitud de la vibración aumenta y el sonido es más fuerte

Un micrófono conectado al osciloscopio recoge el medio de aire vibrante de la onda de sonido de la energía de la onda de sonido y lo convierte (produce) señales eléctricas y electrónicas. El osciloscopio, que está diseñado para mostrar señales electrónicas, muestra las señales electrónicas transmitidas por el micrófono en la pantalla con los mismos valores de amplitud y frecuencia que el volumen y el tono de la onda de sonido, respectivamente.

Las características observables son;

1) El volumen o el volumen de la onda de sonido que se muestra como la amplitud) en el cátodo, con una amplitud más alta que representa un sonido más fuerte

2) El tono de la onda de sonido se muestra como el espaciado de onda en el osciloscopio, el sonido de tono más alto se muestra por las ondas que se acercan en la pantalla

Explanation:

7 0
3 years ago
What is the difference between a switch's physical interface and the vlan interface?
Andreyy89
<span>Switch's physical interface is something as the name itself suggests itself that it is a physical port to which you can plug in a cable or a wire based on its function and usage where as VLAN interface is no physical port but are created virtually when needed.</span>
4 0
4 years ago
Read 2 more answers
Which network protocol is used to route IP addresses?<br>A. TCP<br>B. UDP<br>C. IP<br>D. ICMP
ladessa [460]

Answer:

C. IPIP

Explanation:

This protocol is known as an IP that stands for Internet Protocol. This protocol handles the simple task of making sure that the information is routed correctly to and from the corresponding computer machines through the internet. The sending and receiving machines are identified through their Internet Protocol Addresses which lets the protocol know exactly where the information is going and being sent from.

8 0
4 years ago
PLEASE I NEED HELP PLEASE PLEASE<br> Which function prompts the user to enter information?
Stels [109]

In python the input() function prompts the user to enter information.

5 0
3 years ago
In the story, what are the song pauses a metaphor for?
-BARSIC- [3]

Answer:

D. The need to slow down more often in life.

4 0
3 years ago
Other questions:
  • ___ Jacking is a crime that takes place when a hacker misdirects URL to a different site. The Link Itself Looks Safe, But the us
    11·1 answer
  • Can you structure this code in if-statements?
    15·1 answer
  • Hunter took his sick puppy to Jade to get medication. Jade is
    14·2 answers
  • You are the IT Administrator for a small corporate network. Until now, the network has consisted only of workstations accessing
    6·1 answer
  • JAVA
    12·1 answer
  • With a heat exchanger, the temperature of the process fluid can be measured with a temperature-
    14·1 answer
  • PLSSSSS HELPP!! Tropical rainforests are home to many kinds of birds, including parrots, toucans and eagles. Each different spec
    9·2 answers
  • If i hit the delete key three times what will be left
    12·1 answer
  • List six features of the Microsoft ​
    10·1 answer
  • which one of the following would not normally be found in an organization's information security policy?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!