I need help with a couple of programs. Create a program that will calculate payroll. It should check for hourly vs. salaried (a-$750, b-$1,500, c-$3,000/wk), pay scale (a-$7.50, b-$15.00, c-$30.00/hr). If the employee is hrly and works over 40hrs/wk, they get time and a half. (use if-then structures)
Create a program that will accept a classmate name and provide the following information: correct/legal first, middle, and last name; DOB, address, phone, height, weight. (use case structures)
Please help
Wildflower
Posts: 5 | Location: Lewis Run, Pa. US | Registered: 11-14-03
Wildflower, that is a lot of coding, are you needing help figuring out the algorithm or is it the actual VB sequencing and/or structure? LEt me know what you need and I can help but since this is apparently for a class I don't want to write out the whole thing.
Kwll It is structure and this is what I have so far but it doesn't work. const salaryA=750 const salaryB=1500 const salaryC=3000 const HourlyA=7.50 const HourlyB=15.00 const HourlyC=30.00
Dim base as single
If salary then If salaryA then pay 750 else if salary B pay 1500 else if salary C pay 3000 pay=salary C end if end if end if else if hrs>40 then if hourlyA then 40*hourlyA=base It's a mess I just don't understand it. Please help if you can.
Thank you Wildflower
Posts: 5 | Location: Lewis Run, Pa. US | Registered: 11-14-03
I've been wrestling with this one for a couple of days because the constraints of the project are not real clear and there are literally dozens of ways to do this one. Here is what I think you should do:
Write an If else statement to determine if the pay type is hourly or salary. Then nest in the salary statement some else if statements to determine the salary type resulting in the proper amount. You will then need an else if nest for the hourly for the same thing as salry follwoed by an if then statement for <= 40 and an > 40 parameters for each pay type. The formula for over 40 should be numTotalPay = numPay * (numHours - 40 *(1.5 * numPay)) + (numPay * 40)