yVal windowprompt Enter second integer 0 f Prompt the user to enter a third

Yval windowprompt enter second integer 0 f prompt the

This preview shows page 2 - 3 out of 3 pages.

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>” );
Background image
6.6 Using the statements you wrote in Exercise 6.5, write a complete script that calculates and prints the product of three integers.
Background image

You've reached the end of your free preview.

Want to read all 3 pages?

  • Spring '12
  • NA
  • ASCII, relational operator

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes