This assignment has a series of problems I want you to solve by writing the
JavaScript code.
- Problem #1: Take in the name of an item, the price of the item and the cost of the item.
On the document write the name of the item and the profit that you can get from the
item. Remember profit is price - cost.
- Problem #2: Take in the pay per hour, the hours worked, and the withhold amount.
Multiply the pay per hour by the hours worked to get the gross pay. Subtract the withhold
amount to get the net pay. Display both the gross pay and the net pay.
- Problem #3: Take in the number of points earned and take in a ranking. If the ranking is A
you want to check the number of points. If the number of points is > 100 you want to print out
a message that says excellent. If the number of points is not > 100 then print out a message that
says OK.
- Problem #4: Take in the student name. Take in the grade for the first test, the
grade for the second test, the grade for the third test and the grade for the fourth
test. Determine the average grade for the four tests. Display the student name and
the average grade. Use if statements to determine the letter grade and display the
letter grade.
- Problem #5: Write a loop that prompts the user for the amount they just spent and displays
the amount and the total spent so far. When the total becomes larger than 500, stop the loop.