harrypotterfan
New Member
- Joined
- Sep 27, 2005
- Messages
- 2
Can anyone help with this program?
This is a console payroll application. I need to pass arguments to/from procedures. In an indirect manner, this program will demonstrate the need to be able to return more than one value from a procedure.
The input for this problem will be:
1. The number of hours the employee worked during the prior week.
2. The employee's hourly pay rate.
3. The employees number of dependents.
Based on this information, I need to compute the employee's gross earnings, taxes to be withheld, medical insurance premium, and the net pay. This information should be printed for each individual employee.
Computation definitions are:
REGULAR PAY: Regular pay is based on hours worked times hourly pay rate for the first 40 hours in a pay period.
OVERTIME PAY: The employee receives a 50% premium for all hours worked in excess of 40, i.e., the classic "time and a half" for any hours worked over 40.
TAXES WITHHELD: The withholding schedule is 15% on the first $200 earned; 18% the next $100 (earnings between $200 and $300); and 23% on all earnings above $300. Taxes are computed on the gross pay. For example, gross earnings of $343.00 will result in taxes of $57.89 (.15 * 200 + .18 * 100 + .23 * 43).
MEDICAL PREMIUM: Medium premium is the sum of the premium for the employee and his deductions, if any. Each employee is required to contribute $12.50 per week for his/her medical insurance. Deductions for dependents are given in the following table:
Dependents Additional Premium
1 $ 6.00
2 $10.50
3 - 6 $ 4.85 for each dependent
Over 6 $ 4.60 for each dependent
NET PAY: Regular Pay plus Overtime Pay less Taxes Withheld less Medical Premium.
OUTPUT: The output should contain the regular pay, overtime pay, taxes withheld, number of dependents, medical deduction, and net pay in an easy to read format with items labeled clearly.
PROGRAM SPECIFICATIONS:
1. Set Option Strict On in your code.
2. Use only procedure level variables in the solution. Do not use any variables defined outside a procedure (module variables).
3. Develop the following components for this assignment:
a. A Main procedure, controlling module that calls other procedures which perform the work of the program. The controlling loop will reside in Main. Include an ability to make another calculation (loop). Other procedures will be called from Main.
b. A function procedure that will return a user input value. Call this procedure to obtain input values for the hours worked (decimal), pay rate (decimal) and dependents (integer). This procedure should insure that the input is a non-negative numeric (value is greater than or equal to zero). Use the IsNumeric method to determine if the user has entered numeric values. You may assume that numeric input, for the number of dependents, is an integer number. Hint: call the input procedure three times, once for each input, and supply the prompt as an argument.
c. A procedure (function or sub) that will split the number of hours worked into regular hours and overtime hours.
d. A procedure that will calculate and return the regular pay and overtime pay given the regular hours worked, overtime hours worked, and rate of pay.
e. A function procedure that will calculate and return the taxes to be paid, given regular pay and overtime pay.
f. A function procedure that will calculate and return the medical premium from the number of dependents.
g. A sub procedure that will accept values for the regular pay, overtime pay, tax paid, medical premium. The procedure will calculate net pay and print all the output.
h. A function procedure that will return a value to see if the user wishes another cycle. The function must validate the user's response before returning its value. Only valid user responses will be returned; for an invalid response, inform the user of the improper response and prompt anew. There will be no case sensitivity for the user's response.
Thanks for any help I can get!
This is a console payroll application. I need to pass arguments to/from procedures. In an indirect manner, this program will demonstrate the need to be able to return more than one value from a procedure.
The input for this problem will be:
1. The number of hours the employee worked during the prior week.
2. The employee's hourly pay rate.
3. The employees number of dependents.
Based on this information, I need to compute the employee's gross earnings, taxes to be withheld, medical insurance premium, and the net pay. This information should be printed for each individual employee.
Computation definitions are:
REGULAR PAY: Regular pay is based on hours worked times hourly pay rate for the first 40 hours in a pay period.
OVERTIME PAY: The employee receives a 50% premium for all hours worked in excess of 40, i.e., the classic "time and a half" for any hours worked over 40.
TAXES WITHHELD: The withholding schedule is 15% on the first $200 earned; 18% the next $100 (earnings between $200 and $300); and 23% on all earnings above $300. Taxes are computed on the gross pay. For example, gross earnings of $343.00 will result in taxes of $57.89 (.15 * 200 + .18 * 100 + .23 * 43).
MEDICAL PREMIUM: Medium premium is the sum of the premium for the employee and his deductions, if any. Each employee is required to contribute $12.50 per week for his/her medical insurance. Deductions for dependents are given in the following table:
Dependents Additional Premium
1 $ 6.00
2 $10.50
3 - 6 $ 4.85 for each dependent
Over 6 $ 4.60 for each dependent
NET PAY: Regular Pay plus Overtime Pay less Taxes Withheld less Medical Premium.
OUTPUT: The output should contain the regular pay, overtime pay, taxes withheld, number of dependents, medical deduction, and net pay in an easy to read format with items labeled clearly.
PROGRAM SPECIFICATIONS:
1. Set Option Strict On in your code.
2. Use only procedure level variables in the solution. Do not use any variables defined outside a procedure (module variables).
3. Develop the following components for this assignment:
a. A Main procedure, controlling module that calls other procedures which perform the work of the program. The controlling loop will reside in Main. Include an ability to make another calculation (loop). Other procedures will be called from Main.
b. A function procedure that will return a user input value. Call this procedure to obtain input values for the hours worked (decimal), pay rate (decimal) and dependents (integer). This procedure should insure that the input is a non-negative numeric (value is greater than or equal to zero). Use the IsNumeric method to determine if the user has entered numeric values. You may assume that numeric input, for the number of dependents, is an integer number. Hint: call the input procedure three times, once for each input, and supply the prompt as an argument.
c. A procedure (function or sub) that will split the number of hours worked into regular hours and overtime hours.
d. A procedure that will calculate and return the regular pay and overtime pay given the regular hours worked, overtime hours worked, and rate of pay.
e. A function procedure that will calculate and return the taxes to be paid, given regular pay and overtime pay.
f. A function procedure that will calculate and return the medical premium from the number of dependents.
g. A sub procedure that will accept values for the regular pay, overtime pay, tax paid, medical premium. The procedure will calculate net pay and print all the output.
h. A function procedure that will return a value to see if the user wishes another cycle. The function must validate the user's response before returning its value. Only valid user responses will be returned; for an invalid response, inform the user of the improper response and prompt anew. There will be no case sensitivity for the user's response.
Thanks for any help I can get!