# VB.NET Help - payroll console application program



## harrypotterfan (Sep 27, 2005)

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!


----------



## Smitty (Sep 28, 2005)

Welcome to the Board!

Yes, someone can help...But this smells suspiciously like homework.

Not that anyone minds per se, but you've got to do some work on your own and ask some specific questions, other than throwing a complete project out there (unless you want to pay for it).  If that's the case, then e-mail Mr.Excel @ consult@mr.excel.com.  That's what the folks behind this site do for a living and they're good at it.

If it's something you want to do on your own, then my apologies, but you'll, still need to post some specifics (key point being specifics, as in one step at a time), and make use of the board features to post a shot of what you have and your desired outcome (as you see it).

Smitty


----------



## mdmilner (Oct 4, 2005)

Just a tip on technique.

If you need to return multiple values, you can either return a delimited string OR an array and you don't even need to know how many positions are within the return array if you use Ubound to test the returned value.

Mike


----------

