A WebPage the Calculates the Cost per Square Inch of Pizza
Not what you're looking for?
Exercise 15.19
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 names pizza.htm that determine 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 (ie. 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/(pi*(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.
Purchase this Solution
Solution Summary
This solution provides a webpage with a function that will help determine the cost of a pizza.
Purchase this Solution
Free BrainMass Quizzes
Basic Networking Questions
This quiz consists of some basic networking questions.
C++ Operators
This quiz tests a student's knowledge about C++ operators.
Word 2010: Table of Contents
Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.
Inserting and deleting in a linked list
This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.
Java loops
This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.