Answer to Question #284950 in Python for eiss

Question #284950

Malayan Yellow Hut’s Pizza parlor has specialized systems that can identify how many slices that can be taken from a pizza of a given size. This system uses the following facts:


·      Each slice should have an area of 14.125 inches.

·      To calculate the number of slices, simply divide the area of the pizza by 14.125

·      The area of the pizza is calculated using the formula area = πr2.

 

Improve their systems by allowing it to identify how many pizzas should be ordered given a number of people expected to eat and the diameter of the pizza. Assume that each person is expected to eat an average of 4 slices.


Input:


1. nOp


Description

no of person

2. dia


Description

diameter of pizza

Output:

Enter·the·number·of·person:·30

Enter·the·diameter·of·the·pizza:·12

You·should·order·15·pizzas·for·30·persons.


1
Expert's answer
2022-01-05T16:25:28-0500
import math

No_of_Persons = int(input("Enter No. of Persons: "))

AvgDiet = 4    # Avg. Diet per person
SliceArea = 14.125
print("Unit Slice Area = ",SliceArea)
print("Avg. Diet per person = ",AvgDiet)

RequiredPizzaArea = No_of_Persons*SliceArea*AvgDiet
print("Required Pizza Area = ",RequiredPizzaArea," sq. inch")
PI = 3.157
R = math.sqrt(RequiredPizzaArea/PI)       # Radius of Pizza
D = round(2*R,2)
print("Required Diameter of Pizza = ",D," inches")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS