Question: Write JS statement ( or comment ) to accomplish each of the following tasks: a ) State that a script will calculate the product of
Write JS statement or comment to accomplish each of the following tasks:
a State that a script will calculate the product of three integers. Hint: Use text that helps
to document a script.
b Declare the variables x y z and result.
c Declare the variables xVal, yVal and zVal.
d Prompt the user to enter the first value, read it from the user and store it in the
variable xVal.
e Prompt the user to enter the second value, read the value from the user and store it in
the variable yVal.
f Prompt the user to enter the third value, read the value from the user and store it in the
variable zVal.
g Convert the string xVal to an integer, and store the result in the variable x
h Convert the string yVal to an integer, and store the result in the variable y
i Convert the string zVal to an integer, and store the result in the variable z
j Compute the product of the three integers contained in variables x y and z and assign
the result to the variable result.
k Write a line of HTML text containing the string "The product is followed by the
value of the variable result.
JS statements for each of the above questions
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
