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 239.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.


<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Commission</title>
<script type="text/javascript">
<!--
var itemcount;
var i;
var sum=0;
var cal;
itemcount = window.prompt("How many item/items Salesman sale last week:");
var count = parseInt(itemcount);
for(i=0;i<count;i++)
{
cal = window.prompt("Enter item number:");
var getprice = parseInt(cal);
if(getprice == 1)
{
sum = sum + 239.99;
}
else if(getprice == 2)
{
sum = sum + 129.75;
}
else if(getprice == 3)
{
sum = sum + 99.95;
}
else if(getprice == 4)
{
sum = sum + 350.89;
}
else
{
window.alert("There is no such Item Number exists, Please try again");
exit();
}
}
var sal= 200 + (( 9 / 100)* parseInt(sum));
document.writeln( "<h1> Total Salary for this salesperson is: " + sal + "</h1>" );
// -->
</script>
</head>
<body>
<h1>Commission</h1>
<hr />

<p>Press F5 or Refresh to load script again.</p>
</body>
</html>