永发信息网

C#的一道题!

答案:1  悬赏:60  手机版
解决时间 2021-07-30 23:27
  • 提问者网友:留有余香
  • 2021-07-30 17:18

    1. In Visual Studio 2008 Create a new C# Windows Console Application named Lab06.
    2. Add a new Class to your project named Payroll with the attributes and methods modeled in your UML.
    3. From Main() prompt the user for the four values required for a Payroll object and take their input from the keyboard.
    4. Instantiate that object using the two parameter constructor and setting the values of hoursWorked and payRate using your setters.
    5. Report the gross pay of the employee.
    6. 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.
    7. Add that getGrossPay(bool) to your UML.
    8. 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.)

11.First – clean up that program adding static methods to program.cs to make it simpler and more modular.

    1. Make it continue to prompt for employees until the user indicates he has no more. You could save the employees in an ArrayList.
    2. After the user indicates he has finished, report the number of employees and the total payroll.
    3. 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.
    4. How about raises?...
最佳答案
  • 五星知识达人网友:玩家
  • 2021-07-30 18:24
设计一个Plyroll类,包含有雇员姓名、ID号码、每小时的费用、工作多少小时这几个数据域。
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯