Whenever you order a pizza, you are faced with the dilemma of which size to order. Is
Question:
Whenever you order a pizza, you are faced with the dilemma of which size to order. Is a large pizza a good deal, or would you be better off ordering two mediums?
Create a Web page named pizza.html that determines the cost per square inch of any pizza.
The page should contain text boxes in which the user can enter the diameter of the pizza (i.e., the number of inches across) and its price. Given this input, the cost per square inch can be computed as:
cost per square inch = cost/(π * (diameter/2)2)
Using the Math.PI property and the Math.pow method, your page should compute and display the cost per square inch for any specified pizza.
Once you have completed the page, use it to determine which would be the better deal: a 16-inch pizza for $18.99 or two 12-inch pizzas for $10.99 each?
Step by Step Answer: