Write a program that reads in the name, hourly rate and number ofhours worked fo
ID: 3619024 • Letter: W
Question
Write a program that reads in the name, hourly rate and number ofhours worked for 5 people. Print the name of each person, thenumber of hours worked, their weekly pay based on the number ofhours they worked and how much they owe in taxes. Assume that taxestake 20% of the paycheck. Don’t forget to take the taxes outof the pay check. If they work more than 40 hours they getovertime. The hourly rate is then 1.5 times normal for all hourspast 40.Example (Sample input & output for one person)
Enter name: Glenn
Enter hourly rate: 4.00
Enter hours worked: 75
Pay to: Glenn
Hourly rate: 4.00
Hours worked: 75.0
Amount paid: $370.00
Taxes paid: $74.00
Explanation / Answer
please rate - thanks your sample has an error. what you have for amount paid isbefore taxes. so I modified the output a little #include #include int main() {int i; double rate, hours, tax, salary,paid; char name[10]; for(i=0;i40) {salary=rate*40; hours-=40; salary=salary+(hours*(rate*1.5)); } else salary=hours*rate; tax=salary*.2; paid=salary-tax; printf("Salary before taxes:$%.2f ",salary); printf("Taxes paid: $%.2f ",tax); printf("Amount paid: $%.2f ",paid); } getch(); return 0; }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.