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
When you sit for a typing test, what is the first thought that crosses your mind?
MaRussiya [10]
<span>When you sit for a typing test, what is the first thought that crosses your mind?
posture</span>
8 0
3 years ago
Read 2 more answers
Some designer suggest that speech recognition should be used in tale phone menu system. This will allow users to interact with t
Sergio [31]

Answer:

My two arguments against the proposal are based on physical side effects and background noise interference.

Explanation:

To start with physical side effects, the use of speech recognition technology might make users experience physical discomfort. This is due to the fact that users who interact with the system by speaking for a long period would experience dry mouth, temporary loss of voice, vocal problems and muscle fatigue. In addition, the fact that users would always speak in an unnatural way to make the system interpret commands effectively could lead to voice strain.  

Also, users need to be in a quiet environment before they can get the best out of speech recognition technology. This is because background noise can interfere with commands and create a mix-up which the system cannot interpret. In other words, when an environment is noisy, speech recognition technology would find it difficult to differentiate between users voice and background noise.

4 0
3 years ago
Software piracy is acceptable as it helps us obtain software cheaper or sometimes even for free.
ELEN [110]

Answer: 1. False 2. True

Explanation: Piracy in any capacity is in fact illegal and might possibly be a felony I'm not quite sure. But it's just like stealing a toy from the store, somebody worked hard to make it and you best be paying for it.

Software licenses on the other hand usually give you permission to install the software on one or many machines depending on the license you purchase, but usually, if you paid for it once, you can use it anywhere.

8 0
3 years ago
Read 2 more answers
Write a program that computes the sum of the first tenpositive integers, 1 + 2 + ..+ 10.
Stella [2.4K]

Answer:

#include <iostream>  

using namespace std;

int main()

{

  int sum=0;//taking an integer variable to store the sum with initial value 0..

  for(int i=1;i<=10;i++)//looping from 1 to 10..

  {

      sum+=i;//adding each i in the sum..

  }

  cout<<sum<<endl;//printing the sum..

   return 0;

}

Explanation:

output :- 55

1.I have taken an integer variable sum which is equal to 0.

2.Looping over first ten positive integers.

3.Adding every number to sum.

4.Printing the sum.

6 0
3 years ago
Which block in this module represents the variable?
sasho [114]

Explanation:

jdbfifnmathljnfeijrjdjej.http.com

6 0
3 years ago
Other questions:
  • Using-R,-create-a-linear-model-to-represent-the-coefficients-for-the-objects-fw2-and-fwe-data..
    10·1 answer
  • 1. Do you consider Facebook, MySpace, and LinkedIn forms of disruptive or sustaining technology? Why?
    15·1 answer
  • What material replaced stone as the primary materials used to make tools and machines by humans
    5·1 answer
  • What is a graphical representation of a real person in a virtual community called?
    5·1 answer
  • Examine the following declarations and definitions for the array-based implementations for the Stack and Queue ADTs. Assume that
    14·1 answer
  • Which is the purpose of adding B-Roll footage to a sequence?
    10·1 answer
  • Network footprinting is used to ______________________. Group of answer choices test for vulnerabilities determine what services
    12·1 answer
  • Any one know??please let me know
    15·2 answers
  • Write this multiplacation statement as repeated addition 5/6 x 3​
    6·1 answer
  • The basic building blocks of java is known as<br><br><br><br>Reply fast! plzzzzzzzzzzz!!!
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!