Question: python without loops Question 2: Pizza Calculator (50 points) Last week, Johnny went to a pizza shop and asked for a 12-inch pizza. The shop
python without loops

Question 2: Pizza Calculator (50 points) Last week, Johnny went to a pizza shop and asked for a 12-inch pizza. The shop owner said they didn't have any 12-inch pizzas left and suggested selling Johnny two 6-inch pizzas for the same price. Johnny accepted the offer. After Johnny got home, his girlfriend told him that he had been ripped off. The area of a circle is Area = r2 Where r is the radius of the circle and is roughly 3.14. So, the 12-inch pizza, with a radius of 6 inches, has an area of 3.14 * 62 = 113.04 whereas a 6-inch pizza, with a radius of 3 inches, has an area of 3.14 * 32 = 28.26 This means that two 6-inch pizzas only have an area of 28.26 + 2 = 56.52! Thus, two 6-inch pizzas are equivalent to only half of a 12-inch pizza! Feeling slightly traumatized by this experience, Johnny decides to hire you to write a Python program to prevent being ripped off again by unethical pizza shops. For this question, create a program called pizza_calculator.py and write the following functions: display_welcome_menu: This function takes no input and displays a welcoming message as well as a list with all the options available to Johnny (the user). That is, >>> display_welcome_menu() Welcome to the COMP 202 fair pizza calculator! Please chose one of the following modes: A. "Quantity mode" B. "Price mode" get_fair_quantity: This function takes two positive integers as input representing the diameters of two pizzas. The function returns an integer indicating the minimum number of smaller pizzas Johnny must order in order for him to get at least the same amount of pizza as one large pizza. For example: >>> get_fair-quantity(14, 8) 4 >>> get_fair-quantity(8, 14) 4 >>> get_fair-quantity(14, 5) 8 >>> get_fair-quantity(5, 5) 1 get_fair_price: This function takes as input an integer indicating the diameter of the large pizza, a real number indicating the price of the large pizza, an integer indicating the diameter of the small pizza, and one last integer indicating the number of small pizzas to be ordered. You can assume the inputs will always be positive numbers in the order just specified. The function returns the total price Johnny should be paying to buy the smaller pizzas such that the amount of pizza per dollar is the same as that of the larger pizza. The return value should be a real number with no more than 2 digits after the decimal point
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
