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
xenn [34]
4 years ago
12

Write a program to help you feed your friends at a party by doing some math about square pizzas. Assume the grader defines a str

ing inputStr for you, which is a decimal string meaning the side length L of the pizza in cm. The area of the pizza should be computed using the formula A = L*L. Then, assuming that each person needs to eat 100 cm2 of pizza, compute the number of people it can feed, rounded down to the nearest integer
Computers and Technology
1 answer:
Nina [5.8K]4 years ago
3 0

Answer:

Following are the program in the Python Programming Language.

#get input from the user length of the pizza

inputStr = input('Enter the length of pizza: ')

#convert input into float

L = float(inputStr)

#initialize the area of the pizza

A = L*L

#calculate the amount of peoples can eat pizza

men = int(A/100)

#print the number of peoples

print('\nPizza can be eaten by {} people'.format(men))

<u>Output</u>:

Enter the length of pizza: 20

Pizza can be eaten by 4 people

Explanation:

<u>Following are the description of the program</u>.

  • Firstly, set a variable that get length input from the user.
  • Set variable 'L' that convert the input from the user into the float data type.
  • Set variable 'A' that stores the area of the pizza.
  • Set variable 'men' that store the amount of peoples can eat pizza.
  • Finally, print the number of peoples can eat pizza.
You might be interested in
Three reasons why users attach speakers to their computers.
ZanzabumX [31]

Answer:

Iv'e answered this question 2 times already lol. The purpose of speakers is to produce audio output that can be heard by the listener. Speakers are transducers that convert electromagnetic waves into sound waves. The speakers receive audio input from a device such as a computer or an audio receiver.

Explanation: I hope this helps!

8 0
3 years ago
Try running your function with the number 0 as the input, and see what you get
leva [86]
The correct answer is 25
6 0
2 years ago
How would you convert this base 10 decimal into a base 2number?:
Tju [1.3M]

Answer:

The method of converting a base 10 or decimal number into base 2 or binary number is as following:-

  1. Divide the decimal number by 2 and store it's remainder.
  2. keep dividing the decimal number by 2 until it becomes 0 and also keep storing it's remainder.
  3. Then write the remainders in reverse order.This the binary number.

Refer the attached image for better explanation.

6 0
4 years ago
Define Auxiliary memory?​
andrew-mc [135]

Answer:

An Auxiliary memory is referred to as the lowest-cost, highest-space, and slowest-approach storage in a computer system. It is where programs and information are preserved for long-term storage or when not in direct use. The most typical auxiliary memory devices used in computer systems are magnetic disks and tapes. :)

5 0
3 years ago
Read 2 more answers
The practice of texting is most popular and what age group
Diano4ka-milaya [45]
Mostly teenagers and young adults (ages 14-21) text the most.
4 0
3 years ago
Read 2 more answers
Other questions:
  • In pre-shared key mode, a passphrase should be at least ________ characters long.
    15·1 answer
  • Does anyone know the code for codeHS 5.4.7 teenagers?
    8·1 answer
  • What is the khan academy game where it is a block having to jump over lava and is an endless runner
    9·1 answer
  • In cell F15, insert a function that will automatically display the word Discontinue if the value in cell D15 is less than 1500,
    6·1 answer
  • What is your favorite food
    11·2 answers
  • Write a statement that declares a prototype for a function printArray, which has two parameters. The first parameter is an array
    5·1 answer
  • 55 POINTS, IN JAVA
    5·1 answer
  • Write a program called array1.cpp file that use either regular for loop or range based for loop to display the contents of the a
    14·1 answer
  • Define 'formatting'<br>​
    8·2 answers
  • Điền dữ liệu cho cột Phân loại theo điều kiện sau:
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!