Question

Description Write a program that reads in the name, hourly rate and number of hours worked...

  1. Description

Write a program that reads in the name, hourly rate and number of hours worked for 5 people. Print the name of each person, the number of hours worked, their weekly pay based on the number of hours they worked and how much they owe in taxes. Assume that taxes take 20% of the paycheck. Don’t forget to take the taxes out of the pay check. If they work more than 40 hours they get overtime. The hourly rate is then 1.5 times normal for all hours past 40.

Example (Sample input & output for one person)

Enter name: Jian an Liu

Enter hourly rate: 4.00

Enter hours worked: 75

Pay to: Jian an Liu

Hourly rate: 4.00

Hours worked: 75.0

Amount paid: $370.00

Taxes paid: $74.00

Take home: $296.00

Homework Answers

Answer #1

`Hey,

Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

#include <stdio.h>
int main()
{int i;

for(i=0;i<5;i++)
{
double rate, hours, tax, salary,paid;
char name[100];
fflush(stdin);
printf("Enter name: ");
scanf("%[^\n]s",&name);
printf("Enter hourly rate: ");
scanf("%lf",&rate);
printf("Enter hours worked: ");
scanf("%lf",&hours);
printf("Pay to: %s \n",name);
printf("Hourly rate: %.2f\n",rate);
printf("Hours worked: %.2f\n",hours);
if(hours>40)
{salary=rate*40;
hours-=40;
salary=salary+(hours*(rate*1.5));
}
else
salary=hours*rate;
tax=salary*.2;
paid=salary-tax;
printf("Amount paid: $%.2f\n",salary);
printf("Taxes paid: $%.2f\n",tax);
printf("Take home: $%.2f\n\n",paid);
}
return 0;
}

Kindly revert for any queries

Thanks.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Hourly workers are paid at their regular pay rate for their first 40 hours worked each...
Hourly workers are paid at their regular pay rate for their first 40 hours worked each week. Any hours beyond that are considered overtime, and they get paid "time-and-a-half" for those hours (1-1/2 times their regular pay rate). For example, if a worker normally makes $12.00 per hour and has worked 45 hours in the past week, the pay is computed as follows: 40 times $12 for the "regular" hours is $480. The extra 5 hours is overtime and is...
1) . Joe Wilkes earns $4,000 per month. He worked 22 hours of overtime this month....
1) . Joe Wilkes earns $4,000 per month. He worked 22 hours of overtime this month. Joe's gross salary for the month is a) . $6,031.25 b) . $4,230.37 c) . $4,761.64 d) . $7,115.15 2) . When an employee is in a profession that is customarily tipped a) . must deduct all tips from the gross salary. b) the employer may take a $5.12 credit towards the minimum wage under federal law. c) the employer may deduct all tips...
Python Coding Federal law requires that hourly employees be paid “time and a half” for all...
Python Coding Federal law requires that hourly employees be paid “time and a half” for all work above 40 hours per week. Write a program that prompts the user to enter their hours worked and hourly wage (e.g. $20.00/hr) and then computes and prints their pay. The program should test the number of hours worked to determine if any overtime pay is due. As an example for regular pay (no overtime) suppose that a worker makes $10/hr and works 40...
Create a C# application You are to create a class object called “Employee” which included eight...
Create a C# application You are to create a class object called “Employee” which included eight private variables: firstN lastN dNum wage: holds how much the person makes per hour weekHrsWkd: holds how many total hours the person worked each week. regHrsAmt: initialize to a fixed amount of 40 using constructor. regPay otPay After going over the regular hours, the employee gets 1.5x the wage for each additional hour worked. Methods:  constructor  properties  CalcPay(): Calculate the regular...
Example 2-19 Matt Leonard earns $739.20 a week with fluctuating workweek hours. If he worked 48...
Example 2-19 Matt Leonard earns $739.20 a week with fluctuating workweek hours. If he worked 48 hours in one week, his gross pay would be calculated as follows: $739.20 ÷ 48 hours = $15.40 regular rate $15.40 × 0.5 = $7.70 extra half pay rate 8 hours O.T. × $7.70 = $61.60 extra pay $739.20 + $61.60 = $800.80 weekly gross pay Example 2-21 The agreement between John Kalas and his employer provides for a pay rate of $14 per...
Franklin Industries pays employees 10% of their hourly rate as a premium for working the evening...
Franklin Industries pays employees 10% of their hourly rate as a premium for working the evening shift. Ray’s regular hourly rate is $12.25; this week he worked 40 hours on the evening shift. Calculate shift premium paid to employees.   Jupiter Textiles, located in BC , makes a bi weekly salary payment of $ 2,150 and an overtime payment of $200 to David on the same cheque. Calculate David’s gross insurable income and EI per pay period. Complete the following table...
1. In a separate JS file, write a function to calculate gross wages for an hourly...
1. In a separate JS file, write a function to calculate gross wages for an hourly employee. The function should receive two parameters: the pay rate (dollars per hour, a floating point number) and the hours worked. Hours from 0 through 40 are “straight time” pay, and any hours in excess of 40 are overtime pay at 1.5 times the standard rate (hint: use the ? : operator to make a decision about pay rates). The function should return a...
Design a PayRoll class that has data members for an employee’s hourly pay rate, number of...
Design a PayRoll class that has data members for an employee’s hourly pay rate, number of hours worked of type double. The default constructor will set the hours worked and pay rate to zero. The class must have a mutator function to set the pay rate for each employee and hours worked. The class should include accessors for both the hours worked and the rate of pay. The class should lastly have a getGross function that will return a double...
Please assist with the following problem: Employees’ earnings using hourly and piece-rate methods The payroll records...
Please assist with the following problem: Employees’ earnings using hourly and piece-rate methods The payroll records of Grove Machining Co. show the following information for the week ended April 17: Employee Classification Hours Worked Production (Units) Rate Income Tax W/held Manressa, C. Direct 42 $18.00/hr $80 Dorr, M. Direct 48 $17.60/hr 84 Ginty, D. Direct 39 2,000 $.44/piece 110 Norris,D Direct 40 1,800 $.44/piece 100 Rancifer, K. Indirect 40 $800/wk 100 Greer, B. Indirect 50 $1,600/wk 240 Holbert, R. Indirect...
17. Martin Jackson receives an hourly wage rate of $23, with time-and-a-half pay for all hours...
17. Martin Jackson receives an hourly wage rate of $23, with time-and-a-half pay for all hours worked in excess of 40 hours during a week. Payroll data for the current week are as follows: hours worked, 45; federal income tax withheld, $207; social security tax rate, 6.0%; and Medicare tax rate, 1.5%. What is the net amount to be paid to Jackson, rounded to the nearest cent? a.$803.56 b.$1,092.50 c.$1,470.56 d.$1,781.06 20. The independent auditor's report a.describes which financial statements...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT