Question
What size pizza is the best buy? Which size gives the lowest cost per square inch? Pizza sizes given in diameter. Quantity of pizza is
What size pizza is the best buy?
Which size gives the lowest cost per square inch?
Pizza sizes given in diameter. Quantity of pizza is based on the area which is proportional to the square of the radius.
Buying Pizza Problem Definition Input: Diameter and cost of at least two sizes of pizza.
Output: Which size is the best buy, Based on lowest price per square inch, If cost per square inch is the same, the smaller size will be the better buy.
Requirements Divide this task into several subtasks. Some of subtasks may be divided into a few sub-subtask. State those in comment lines in your code. Program asks user to input at least two sizes and costs of pizza. After user inputs the size and cost of second pizza, program asks user to input [Y/N] whether user wants to input more pizza info. If user says Y, program prompts user to input the size and cost of a new pizza, Repeat this until user says N (not says Y). Program outputs the size of best-buy pizza, and then ends. Use an appropriate data type for each variable declared in your code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started