Computer Science / Java Lab Assignment # 03b
The Sales Program / 100 Point Version Only
Assignment Purpose:
The purpose of this program is to demonstrate knowledge of selection control structures in a practical program.

Write a program which will process data and information relating to sales in dollars, then compute the amount of salary the sales person will receive, including a Christmas bonus if applicable, and finally print out an appropriate message. The program will declare and initialize variables of appropriate data types for the minimum sales amount, the actual sales amount, and the target sales amount.

Here are the requirements for the program, which need to be applied in this order:

1.  The sales amount must be at least $100,000 to receive 10% of sales salary.

2.  If the sales amount is less than $100,000, the sales person only receives 5% of sales as salary.

3.  If the sales amount is greater than $500,000, the sales person receives a $1000 Christmas bonus, on top of the 10% of sales salary.

4.  See output below for appropriate messages for different scenarios.

Lastname1stinitial_Lab03b_Sales.java / Start with the program below.
/**
* @(#)Hannag_Lab03b_Sales.java
* This program will process data and information relating to sales in dollars,
* then compute the amount of salary the sales person will receive,
* including a Christmas bonus if applicable,
* and finally print out an appropriate message.
* @author Mrs. Hanna
* @version 1.00 2011/11/29
*/
public class hannag_Lab03b_Sales
{
public static void main (String args[])
{
//Declaration of variables
double minSalesAmt = 100000;
double actSalesAmt = 799999.99;
double targetSalesAmt = 500000;
double salary;
double bonus;
//if actual sales are less than the minimum sales amount ($100,000), compute salary as 5% of sales amount.
// Otherwise (else): (HINT: Use block structure { } for 1-3 below!)
1.)  Compute salary as 10% of sales amount.
2.)  If actual sales are more than or equal to target sales amount ($500,000), then sales agent receives a $1000 Christmas bonus added to the 10% of sales salary. NOTE: If actual sales are exactly equal to the target sales amount of $500,000, the output says “You sold half a million dollars …”, otherwise the output says “You sold over half a million dollars …”.
}//end of main
}//end of program


100 Point Version: Sales less than $100,000. (Sample output run with actSalesAmt = $99,999)

100 Point Version: Sales between $100,000 and $500,000. (Sample output run with actSalesAmt=$250,000)

100 Point Version: Sales equal to $500,000. (Sample output run with actSalesAmt=$500,000)

100 Point Version: Sales more than $500,000. (Sample output run with actSalesAmt=$800,000)

1 of 2