Answer to Section 7.13 Write a JavaScript Program for the following problem.

A large company pays its salespeople on a commission basis. The salespeople receive $200 per week, plus 9 percent of their gross sales for that week. For example, a salesperson who sells $5000 worth of merchandise in a week receives $200 plus 9 percent of $5000, or a total of $650. You have been supplied with a list of the items sold by each salesperson. The values of these items are as follows:
Item Value
1 23.99
2 129.75
3 99.95
4 350.89

Develop a program that inputs one salesperson’s items sold for last week, calculates the salesperson’s earnings and outputs XHTML text that displays the salesperson’s earnings.
Back to chapter 7


Commission Calculator

Base commission: $.00

Earning percentage: %

Salesperson Info

Name:

Items Sold

Item 1: @ $23.99 ea
Item 2: @ $129.75 ea
Item 3: @ $99.85 ea
Item 4: @ $350.89 ea

Name Total Sold Commision