Write a program to calculate an emploryee\'s weekly pay. The four inputs are hou
ID: 3628561 • Letter: W
Question
Write a program to calculate an emploryee's weekly pay. The four inputs are hours worked, hourly pay rate, number of dependents (assume < 13), and tax bracket. The three outputs will be gross pay (including overtime, which is at time and a half), federal tax, and net pay.
To calculate federal tax, there are 3 tax brackets (bracket 1 is 13 %, bracket 2 is 27% and bracket 3 is 35%), you also need to deduct 1% from the tax bracket rate for each dependent to get the actual tax rate. If a bad tax bracket is entered, assume tax bracket 3.
Examples:Hours worked: 50 pay rate : 20, dependents:3, tax bracket: 2, then gross pay = 40 *20 +10 *20 *1.5 = =$1100.00. For tax bracket 2 the rate is 27% - 3% for depents, gives a tax rate of 24%, and a federal tax of 1100 * .24 = $264.00. Finally the weekly net pay would be1100 - 264 = $836.00.
Explanation / Answer
#include using namespace std; int main() { int hoursWorked, numDep, taxBrack; double payRate; cout > payRate >> numDep >> taxBrack; double gross=payRate*hoursWorked; coutRelated Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.