C# Programming

  • Thread starter Thread starter yazvigorous
  • Start date Start date
Y

yazvigorous

Guest
Create a program that will calculate employee’s monthly gross pay as follows:

Inputs:

  1. Name
  2. Annual Salary
  3. Monthly Sales
  4. Keeps asking for additional inputs and creating the outputs until an empty name is entered.

Outputs:

  1. Name
  2. Monthly Base Pay (Salary / 12)
  3. Commission calculated as follows:
    1. Subtract 10 * Monthly Base Pay from Monthly Sales giving Net Sales
    2. If the Net Sales is <= 0, then the Commission is 0
    3. Otherwise the First $10,000 in Net Sales is commissioned at 5%
    4. The next $15,000 in Net Sales is commissioned at 10%
    5. The next $25,000 in Net Sales is commissioned at 15%
    6. Any Net Sales over $50,000 is commissioned at 20%
  4. Gross Pay (Monthly Base Pay + Commission).
  5. 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:

  1. Create a class to contain the employee data.
    1. Need class attributes for: name, base pay, sales
    2. Create accessors and mutators for all the data above
    3. Create routine to return gross pay
    4. Create constructor(s)
  2. Create an array of that class.
  3. Create a menu system that allows:
    1. Employees to be added to the employee list
    2. Sales for month to be entered
    3. Report on pay created
    4. Exit the program
  4. You may use global variables for the item 2 array and the number elements in the array in use.
  5. Create static methods to:
    1. Handle menu
    2. Add new employees
    3. Enter sales for month
    4. 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...
 
Back
Top