Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You want to order pizza for dinner, and as a poor college student you'd like to maximize your pizza per dollar. You need to determine

image text in transcribed
You want to order pizza for dinner, and as a poor college student you'd like to maximize your pizza per dollar. You need to determine whether a large or a medium circular pizza is the better deal. Within your Labi folder, write a program named Pizza. java that asks the user to enter four inputs: 1) the diameter of a medium pizza (in inches), 2) the price of a medium pizza in dollars), 3) the diameter of a large pizza (in inches), and 4) the price of large pizza (in dollars). Your program should then calculate and show how much pizza per dollar you're getting for each size, in terms of pizza area (in square inches) per dollar. Math reminders: The area A of a circle is A = ar?, where r is the circle's radius. The value of n is approximately 3.14159. You can use Math.PI in a Java program to get the value of accurate to about 15 decimal places. The radius of a circle is half the circle's diameter. Here's an example of what your completed program might look like when you run it. Underlined parts indicate what you type in as the program is running Please enter the following info: Medium pizza diameter (in.): 12 Medium pizza price ($): Large pizza diameter (in.): 14 Large pizza price ($): 7.99 Medium pizza per dollar: 18.881024295364366 sq. in. per $ Large pizza per dollar: 19.266337925644535 sq. in. per $

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

Step: 3

blur-text-image

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

1 2 3 Data Base Techniques

Authors: Dick Andersen

1st Edition

0880223464, 978-0880223461

More Books

Students also viewed these Databases questions