Y
yazvigorous
Guest
Create a program that will calculate employee’s monthly gross pay as follows:
Inputs:
Outputs:
Additional Requirements:
:Example input and Output (user input in Bold):
Enter employee's name (enter nothing to quit): Howard
Enter Annual Salary (0 for pure commission): 30000
Enter Monthly Sales: 40000
Howard Base Salary=$2,500.00 Sales=$40,000.00 Commission=$1,000.00 Gross Pay= $3,500.00
Enter employee's name (enter nothing to quit): Tom
Enter Annual Salary (0 for pure commission): 0
Enter Monthly Sales: 40000
Tom Base Salary= $0.00 Sales=$40,000.00 Commission=$4,250.00 Gross Pay= $4,250.00
Enter employee's name (enter nothing to quit): Sally
Enter Annual Salary (0 for pure commission): 0
Enter Monthly Sales: 60000
Sally Base Salary= $0.00 Sales=$60,000.00 Commission=$7,750.00 Gross Pay= $7,750.00
Enter employee's name (enter nothing to quit): Joe
Enter Annual Salary (0 for pure commission): 30000
Enter Monthly Sales: 20000
Joe Base Salary=$2,500.00 Sales=$20,000.00 Commission= $0.00 Gross Pay= $2,500.00
Enter employee's name (enter nothing to quit):
Continue reading...
Inputs:
- Name
- Annual Salary
- Monthly Sales
- Keeps asking for additional inputs and creating the outputs until an empty name is entered.
Outputs:
- Name
- Monthly Base Pay (Salary / 12)
- Commission calculated as follows:
- Subtract 10 * Monthly Base Pay from Monthly Sales giving Net Sales
- If the Net Sales is <= 0, then the Commission is 0
- Otherwise the First $10,000 in Net Sales is commissioned at 5%
- The next $15,000 in Net Sales is commissioned at 10%
- The next $25,000 in Net Sales is commissioned at 15%
- Any Net Sales over $50,000 is commissioned at 20%
- Gross Pay (Monthly Base Pay + Commission).
- If any of the inputs are unreasonable, tell user with a message and force reentry of the data (e.g. Negative Sales, Annual Salary > $120,000 or < $12,000, if not 0).
Additional Requirements:
- Create a class to contain the employee data.
- Need class attributes for: name, base pay, sales
- Create accessors and mutators for all the data above
- Create routine to return gross pay
- Create constructor(s)
- Create an array of that class.
- Create a menu system that allows:
- Employees to be added to the employee list
- Sales for month to be entered
- Report on pay created
- Exit the program
- You may use global variables for the item 2 array and the number elements in the array in use.
- Create static methods to:
- Handle menu
- Add new employees
- Enter sales for month
- Produce the pay report.
:Example input and Output (user input in Bold):
Enter employee's name (enter nothing to quit): Howard
Enter Annual Salary (0 for pure commission): 30000
Enter Monthly Sales: 40000
Howard Base Salary=$2,500.00 Sales=$40,000.00 Commission=$1,000.00 Gross Pay= $3,500.00
Enter employee's name (enter nothing to quit): Tom
Enter Annual Salary (0 for pure commission): 0
Enter Monthly Sales: 40000
Tom Base Salary= $0.00 Sales=$40,000.00 Commission=$4,250.00 Gross Pay= $4,250.00
Enter employee's name (enter nothing to quit): Sally
Enter Annual Salary (0 for pure commission): 0
Enter Monthly Sales: 60000
Sally Base Salary= $0.00 Sales=$60,000.00 Commission=$7,750.00 Gross Pay= $7,750.00
Enter employee's name (enter nothing to quit): Joe
Enter Annual Salary (0 for pure commission): 30000
Enter Monthly Sales: 20000
Joe Base Salary=$2,500.00 Sales=$20,000.00 Commission= $0.00 Gross Pay= $2,500.00
Enter employee's name (enter nothing to quit):
Continue reading...