This is an exercise in client-side javascript - call the


The following is an exercise in Client-Side JavaScript: you will need both an .html file and a .js file.

Create a web page named pizzaCalc.html based on the helloworld.html file from Project 1.

Create a second file pizzaCalc.js that will contain all of your JavaScript code, and connect pizzaCalc.html to pizzaCalc.js.

The .js file must include the use strict directive. Write and test a function that accepts two arguments (the pizza price and pizza diameter), and returns a number ( the cost per square inch of the pizza). Store the function definition in the .js file.

Note that the function does not call prompt, alert or console.log-- it just accepts arguments and returns a value.

Following the function definition, write the JavaScript code to prompt and read the cost of a pizza, and the diameter of a pizza.

Call the function you wrote to calculate the cost per square inch of the pizza, and output the following information in a div element on the web page.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: This is an exercise in client-side javascript - call the
Reference No:- TGS02356773

Now Priced at $12 (50% Discount)

Recommended (91%)

Rated (4.3/5)