answer.
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]
2 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]2 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
c++ Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value is c
Ksivusya [100]

<u>Answer:</u>

<em>int fNumber,scndNumber = -1,  </em>

<em>dup = 0; </em>

<em>do { </em>

<em>cin >> fNumber; </em>

<em>if ( scndNumber == -1) { </em>

<em>scndNumber = fNumber; </em>

<em>} </em>

<em>else { </em>

<em>if ( scndNumber == fNumber ) </em>

<em>duplicates++; </em>

<em>else </em>

<em>scndNumber = fNumber; </em>

<em>} </em>

<em>} while(fNumber > 0 );  </em>

<em>cout << dup; </em>

<u>Explanation:</u>

Here three variables are declared to hold the first number which is used obtain all the inputs given by the user, second number to hold the value of <em>last encountered number and “dup” variable to count the number of duplicate values.</em>

<em>“Do-while”</em> loop help us to get the input check whether it is same as previous input if yes then it <em>adds to the duplicate</em> value otherwise the new previous value if stored.

4 0
1 year ago
Read 2 more answers
What kinds of unstructured data or big data might the BITS corporation want to gather in the future? What kind of devices might
charle [14.2K]

Answer:

Explanation:

There many commercial documents or formats to store like image, video, photos, audio file, web page, PDF, presentations, and we can use some tools to store this commercial data, for example, excel, microsoft access, mysql, sql, mongo db, and any tool to manage, store in our data with some structures and big data.

7 0
2 years ago
Which presenter would most likely benefit from a custom slide show?
PIT_PIT [208]
Which presenter would most likely benefit from a custom slide show?

a teacher who teaches four sessions of the same course
3 0
2 years ago
Read 2 more answers
If parties in a contract are not ____, the contract can be canceled.
Anastasy [175]
Agreed to all the terms mentioned in the contract
5 0
2 years ago
Jonah’s friend reminded him to check his report against the rubric provided by their teacher. His friend sent him these instruct
Semenov [28]

Answer:

Steps 2 and 3 needs to be switched.

Explanation:

e2020

8 0
2 years ago
Other questions:
  • Gloria needs to show in spreadsheet form the number of students in her class who speak different languages. Which type of graph
    7·1 answer
  • The memory allocated for a float value is ____ bytes.
    9·1 answer
  • Topological sort requires only a tiny addition to the DFS algorithms. Exactly one of the following data structures is required t
    9·1 answer
  • JAVAThe method longestStreak is intended to determine the longest substring of consecutive identical characters in the parameter
    7·1 answer
  • A user complains that his computer automatically reboots after a short period of time. Which of the following computer component
    10·2 answers
  • You have an on-premises network that contains several servers. You plan to migrate all the servers to Azure. You need to recomme
    14·1 answer
  • Exercise 4: Bring in program grades.cpp and grades.txt from the Lab 10 folder. Fill in the code in bold so that the data is prop
    12·1 answer
  • Write a MATLAB function named average_of_scores_with_drops The function will have two inputs and two return values. The first in
    11·1 answer
  • What is the value of the variable result after these lines of code are executed?
    5·2 answers
  • Write code which takes two inputs from the user, a number of sides followed by a side length, then creates a regular polygon wit
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!