Tom

Tom

  • NA
  • 4
  • 3.7k

C# that has multiple methods but uses parameter types

Oct 15 2012 12:21 PM
Create a program that still has many methods but uses the parameter types
listed below. The program
should be written so it takes input for employee name, hours worked and
hourly rate of pay, and then determines an employees gross pay, State tax,
Federal tax, FICA tax, and net pay using the formulas underneath. Calculations for gross pay, State tax,
Federal tax, FICA tax, and net pay need to be done in separate
methods (5 methods in addition to the Main method).  Calculation of gross pay needs to be done in a
method that uses two value parameters and returns the gross pay.  Calculation of State Tax should be done in a
void method that uses an output parameter for State Tax and a value parameter
for the gross pay.  Other methods should be
void and use reference parameters.  Again,
do not use any global variables.



Gross pay = hours worked times
hourly rate of pay


State tax = Gross pay times 0.02


Federal tax = Gross pay
times 0.20


FICA tax = Gross pay times
0.19


Net pay = Gross pay minus
(State tax +FICA tax  + Federal tax )




Print a prompt message for each input item
telling the user what to enter and then accept values for variables named
hoursWorked and payRate. Loop until 'Quit' is entered for
the employee's name.



Answers (2)