Answer:
# the user is prompted to enter diameter in inch
diameter = int(input("Enter the diameter of the pizza you want (in inch): "))
# the value of PI is saved as a constant
PI = 3.14159
# the area of the pizza is calculated using pi r squared
# the value of r is diameter divide by 2
area = PI * ((diameter / 2) ** 2)
# the value of area is displayed
print(area)
# the number of slice is calculated as area divide by 14.125
# integer division is use to get number of slice
number_of_slice = area // 14.125
# the number of slice is displayed to the user
print("Your number of pizza slice is: ", number_of_slice)
Step-by-step explanation:
The code is written in python and well commented. A sample image of output when code is executed is attached