WDV221 Intro Javascript

Project-5 Loops Project


Please complete the following exercises on this page. When complete post this page to your server. Make a link in your WDV221 homework page for this assignment.

Include a comment in each script with the exercise number and a description of what the script is supposed to do.

Using Blackboard submit this Assignment.


Instructions:

  1. Place all your HTML and Javascript on this page.
  2. Create a function called totalSales( ).
  3. Use a button to call the function.
  4. The function will start a loop that will ask you for a number until you tell the function that you do not have any more numbers to enter.
  5. The number you enter will be added to an accumulator variable.
  6. The loop will count how many numbers were entered.
  7. The loop will ask you if you have more numbers to enter. If you enter ‘yes’ the loop will continue. If you enter 'no' the loop will stop.
  8. Once the loop stops you should display a message that says how many numbers you entered and the total amount of the numbers you entered.
  9. Format the message area to make it easy to find and read.

Note: This type of loop is often used when asking the customer or user for input. Most of the time we do not know how many items the customer has to enter. For example: You need to order a number of products and the loop will ask you for the name, quantity and price for each product. It will keep asking you until you do not have any items left to enter. It will then end the loop and complete its processing.

ReleaseTheMcCracken