hows life fine i guess.Well i have a problem again

• 07-01-2002
datainjector
hows life fine i guess.Well i have a problem again
Since i have started programming in C its been hell for me:mad:

3.21 Develop a program that will determine the gross pay for each employees.The company pays "staight-right" for the first 40 hours worked by each employee and pays " time and a half" for all hours worked in excess of 40 hours.

Enter # of hours worked( -1 to end): 39
Enter hourly rate of the worker (\$00.00):10.00
Salary is \$390.00

Enter # of hours worked( -1 to end): 40
Enter hourly rate of the worker (\$00.00):10.00
Salary is \$400.00

Enter # of hours worked( -1 to end): 41
Enter hourly rate of the worker (\$00.00):10.00
Salary is \$415.00

What do they mean by time-and-a-half???
is it 1.5 times their houly wages???
• 07-01-2002
quzah
Yep. Time and a half is 150% of your normal pay. Likewise, 'double time' and 'double time and a half' ...

Quzah.
• 07-02-2002
Unregistered
This is simple stuff here...Here's the pseudocode:
for each employee,
1) read in the number of hours worked,
2) read in the hourly wage
3) check if number of hours worked > 40 (or whenever overtime starts paying) and then if it is, return the product of hours * wage *1.5
else, return #ofHours * wage

That's it, or at least it seems like it based on your problem spec.
• 07-02-2002
Quote:

3) check if number of hours worked > 40 (or whenever overtime starts paying) and then if it is, return the product of hours * wage *1.5
else, return #ofHours * wage
I spent quite a few minutes rereading this, and this could be very misleading.

Lets say I make \$12 an hour.
Lets say I worked 50 hours.

\$12 * 40 = NormalPay
\$12 * 10 * 1.5 = Overtime
Overtime + NormalPay = Gross
Gross * .75 - .60 (whatever you get taxed) - irrelevant

> What do they mean by time-and-a-half??? is it 1.5 times their houly wages???
Yes.

You don't need to figure out taxes, so that should be an easy piece of code.