- In Visual Studio 2008 Create a new C# Windows Console Application named Lab06.
- Add a new Class to your project named Payroll with the attributes and methods modeled in your UML.
- From Main() prompt the user for the four values required for a Payroll object and take their input from the keyboard.
- Instantiate that object using the two parameter constructor and setting the values of hoursWorked and payRate using your setters.
- Report the gross pay of the employee.
- Overload your getGrossPay() method with a getGrossPay() with one parameter which is a hardship pay boolean. If that parameter is TRUE, multiply the calculated grossPay value you return by 1.25 (make it 25% more). If the parameter is FALSE, don’t apply any increase – just return the calculated grossPay.
- Add that getGrossPay(bool) to your UML.
- Develop a second Payroll object in Main() and use your getGrossPay(bool) method to calculate this employees gross pay (you’ll need to prompt the user again for name, employeeID, hoursWorked and payRate.)
First – clean up that program adding static methods to program.cs to make it simpler and more modular.
-
- Make it continue to prompt for employees until the user indicates he has no more. You could save the employees in an ArrayList.
- After the user indicates he has finished, report the number of employees and the total payroll.
- Now can you take that ArrayList of employees and prompt the user for hoursWorked for a second week. You won’t need to change employeeName, employeeID or payRate.