You are to calculate weekly pay of T employees (1 ≤ T ≤ 1000) based on four factors : rate of pay in dollars, hours worked, tax category, and donations.
Any hours worked over 40 is considered "overtime" and is paid double.
The five tax categories are,
|Tax Category||Tax Deduction|
Input starts with T, followed by the information for T employees on four separate lines. Each employee's information will be seperated with one newline.
Line 1 : a real number denoting rate of hourly pay in dollars (≤ 1000).
Line 2 : an integer denoting hours worked. (< 30000).
Line 3 : a character denoting the tax category of how much tax the government collects.
Line 4 : a "y" or "n" denoting whether they want to donate 10 dollars. Donations are calculated last.
Output each employee's pay in dollars, rounded to two decimal places.
Point Value: 4
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 26, 2008
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Is this the correct input values for the 1st guy's pay?
If so, I was wondering what should be the correct output, my program prints 15116.54
I was just wondering about this, because the second line (indicating hours) is 18467, but the question states that it hours must be less than 216. This is the source of my confusion.
15116.54 is indeed the correct output for that input.
I was just wondering if you could take a look at my submission and see why I get 0/10. I would figure I would at least get 1/10 for getting the first output right then.
Base pay is $1/hr * 41 hours = $41. Right?
Adding double pay is + $1/hr * (41 - 41 = 1) hours = +$1 = $42.
Subtracting tax is -10% = 42 - 4.2 = 37.8...?
Then the donation of $10 makes it $27.80.
So what's wrong?
Thanks in advance for the help.