JavaScript Assignment #2

Problem #1: You need to calculate an employees pay. To do this you will need:
•  the number of hours the employee worked
•  the number of hours the employee is contracted to work before the employee receives overtime (for example, the employee might be contracted to work 40 hours and only receives overtime for hours over 40)
•  the pay per hour
•  the rule for calculating over time (time and one half would be 1.5 while double time would be 2)
Test this problem with information about an employee who did not work over their contracted hours and again for an employee who did work over their contracted hours.

Problem #2: Write the program from the pseudocode in the logic assignment and test it to make sure it is running.

start
  var1 = 10
  var2 = 20
  wksum = 0
  rslt = 0
  do while var2 < 30
     wksum = var1 + var2
     if wksum > 30
        var1 = var1 - 2
        var2 = var2 + 1
     else
        var1 = var1 - 1
        var2 = var2 + 3
     end if
  end while loop
  rslt = var1 + var2
  display rslt
end 

Problem #3: You have received 5 grades in a course. Using a loop that takes in one grade each pass through the loop, determine the average grade. I would suggest adding the grade to an accumulator as you process and calculating the average after the loop is complete.

Problem #4: Instead of 5 grades, you want to set up a loop controlled by user entry. After each grade is taken in, you should ask the user if they want to enter another grade Y or N. When they enter an N, you will determine the average. If they enter a Y then another grade will be entered.

Problem #5: You are playing a game where you gather points. When you pass 200 points you can move to the next level. You need a loop to take in the points that are entered through a prompt and when you pass 200 points you will end and display a message saying you can move on to the next level.