JavaScript Quiz 2

 

Problem #1: Modify the code in example 1 to produce this output if the user enters the name Ann.

 

Hello Ann

See how this works!

 

<HTML>

<HEAD>

<TITLE>Name</TITLE>

</HEAD>

<BODY>

<SCRIPT LANGUAGE="JavaScript">

var theUser = prompt ("Enter you name","It should go here!");

</SCRIPT>

</BODY>

</HTML>

 

Problem #2: Use one of the avgfunc examples (be sure to tell me which one). Modify it so that you take in on hand, on order and the reorder point for an inventory. Calculate the number to order by subtracting the sum of on hand and on order from reorder point. If the number to order is greater than 0, write the number that needs to be ordered, if not write a message saying no order needed.