yVal = window.prompt( “Enter second integer:” “0” );f)Prompt the user to enter a third value, read the value from the user and store it in variable zVal.zVal = window.prompt( “Enter third interger:”, “0” );g)Convert the string xVal to an integer, and store the result in the variable x.var x = parseInt( xVal );h)Convert the string yVal to an integer, and store the result in the variable y.var y = parseInt( yVal );i)Convert the string zVal to an integer, and store the result in the variable z.var z = parseInt( zVal );j)Compute the product of three integers contained in variables x, y, and z, and assign the result to the variable result.result = x * y * z;k)Write a line of HTML5 text containing the string “The product is “ followed by the value of the variable result.document.writeln( “<h1>The product is “ + result + “</h1>” );
6.6 Using the statements you wrote in Exercise 6.5, write a complete script that calculates and prints the product of three integers.
You've reached the end of your free preview.
Want to read all 3 pages?
- Spring '12
- ASCII, relational operator