### BlueBook

## p108ex9: Pay

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 |

A | 0% Tax |

B | 10% tax |

C | 20% tax |

D | 29% tax |

E | 35% tax |

### Input

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

Output each employee's pay in dollars, rounded to two decimal places.

### Sample Input

2

1.0

4

A

n

1.0

41

B

y

### Sample Output

4.00

27.80

All Submissions

Best Solutions

**Point Value:** 4

**Time Limit:** 2.00s

**Memory Limit:** 16M

**Added:** Oct 26, 2008

**Languages Allowed:**

C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

## Comments (Search)

Axiuminon Aug 17, 2019 - 5:42:49 pm UTC Why is my code incorrect?magicalsoupon Aug 19, 2019 - 3:35:06 pm UTC Re: Why is my code incorrect?Waffleson Feb 26, 2019 - 9:30:37 pm UTC Can I get some help?magicalsoupon Feb 27, 2019 - 7:34:33 pm UTC Re: Can I get some help?magicalsoupon Feb 17, 2018 - 12:50:01 am UTC lolmagicalsoupon Feb 17, 2018 - 12:51:45 am UTC Re: lolChinadollon Sep 27, 2016 - 6:32:42 pm UTC Not Working?jargonon Sep 29, 2016 - 4:43:14 am UTC Re: Not Working?ss3happy1on Apr 26, 2015 - 3:02:28 pm UTC Can Someone Help Me Out?18467

A

y

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.

jargonon Apr 26, 2015 - 5:05:23 pm UTC Re: Can Someone Help Me Out?15116.54 is indeed the correct output for that input.

ss3happy1on Apr 26, 2015 - 11:05:31 pm UTC Re: Can Someone Help Me Out?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.

jargonon Apr 27, 2015 - 12:21:58 am UTC Re: Can Someone Help Me Out?SidTrivon Nov 16, 2011 - 12:36:28 am UTCjargonon Nov 16, 2011 - 1:54:28 am UTC Re: ...purohit3105on Nov 14, 2008 - 2:16:45 pm UTC wats wrong?bbi5291on Nov 14, 2008 - 8:14:52 pm UTC Re: wats wrong?jargonon Oct 26, 2008 - 5:47:27 pm UTC Clarification?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.

adminon Oct 26, 2008 - 6:20:38 pm UTC Re: Clarification?--Brian