0
Can anyone program this?
The manager of Mama Calari’s Pizza Palace wants a program that calculates and displays the number of slices of pizza into which a circular pizza can be divided. The manager will enter the radius of the entire pizza. For this exercise, use the number 14.13 as the area of a pizza slice, and use 3.14 as the value of pi.
3 Respuestas
+ 3
Don't ask "Can anyone program this?", ask instead "How can I make a program like this?"
Obviously it is a task given to you, so it's your responsibility. The community helps you if you got into trouble, but they're not into doing the entire work : )
+ 2
You can take the area of the entire pizza and divide it by the area of the slice.
pi = 3.14
s_area = 14.13
r = int(input ())
ans = pi*(r**2)//s_area
print(ans)
Here the no of slices is those tha have same size.
ans = math.ceil(pi(r**2)/s_area)...for all slices even if they are of different sizes.
0
Oh sorry for that Mr Ipang