Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program WITH C++ that calculates and prints the amount of wages due to an employee for a week's work. The program starts by

Write a program WITH C++ that calculates and prints the amount of wages due to an employee for a week's work. The program starts by asking the number of hours worked in the week and the hourly rate. Any hours worked beyond the regular 40 hours and up to 60 hours earns 1.5 times the regular hourly rate. Any hours worked beyond 60 and up to 80 earns 2 times the regular hourly rate.

After reading the hours and hourly rate, the program must also ask if any hours worked in the week was on a holiday. If so, those hours must be deducted from the regular hours and applied a rate of 2 times the regular rate. For example, if hours worked was 40, but 8 of them was on a holiday, 32 hours earns the regular rate and 8 hours at double the regular rate. If 55 hours was worked, but 5 of the hours was on a holiday, 35 hours is regular (40 - 5), 5 hours at twice the rate (for holiday hours), and remaining 15 hours at 1.5 times the regular rate. If 70 hours was put in, 10 of them on a holiday, 30 is at regular rate (40 - 10), 10 at double the rate (for holiday hours), 20 at 1.5 times and the remaining 10 again at double the rate because it was more than 60 (30+10+20+10 = 70).

Finally, ask the user if the employee had a birthday in the week. If so, add a bonus of 7% of the wages due and display the total, including the bonus, in currency format,

Submit only the cpp file.

Example:

Enter hours worked for the week: 45

Enter hourly rate: $10

How many of these were on a holiday? 5

Did the employee have a birthday in the week [y/n]? y

Wages due for the week: $561.75

Press any key to continue.

In the above example, since 5 hours was on a holiday, it leaves 35 for regular hours at $10 an hour ($350), plus 5 holiday hours at double the regular rate ($100), plus the 5 hours that were beyond the regular 40 hours which earn 1.5 times the regular rate ($75), for a total of $525. Finally, since the employee had a birthday in the week, 7% of $525 was added to the total.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

What significant opposition exists?

Answered: 1 week ago

Question

How would you describe your typical day at work?

Answered: 1 week ago