Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The World Wide Web And Databases International Workshop Webdb 98 Valencia Spain March 27 28 1998 Selected Papers Lncs 1590

Authors: Paolo Atzeni ,Alberto Mendelzon ,Giansalvatore Mecca

1st Edition

3540658904, 978-3540658900

More Books

Students also viewed these Databases questions