Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This program reads two values. The first is an hourly wage (double) and the second is the number of hours worked (integer) in a week.

This program reads two values. The first is an hourly wage (double) and the second is the number of hours worked (integer) in a week. The program will compute the total weekly pay based on the following guide.

- Regular time, 0 to 40 hours, use the regular hourly rate

- Overtime, 41-50 hours, regular rate for the first 50 hours and 1.5 times hourly rate for hours over 40.

-Double-time, 51 or more hours, regular rate for the first 40 hours, 1.5 times the hourly rate for the next 10 hours, and 2.0 times the hourly rate for all hours over 50.

Entering 8.50 and 25 gives a weekly pay of $212.50

because 8.5*25(regular) = 212.50

Entering 12.50 and 45 gives a weekly pay of $593.75

because 12.5*40(regular)+12.5*1.5*5(overtime)= 593.75

Entering 17.50 and 65 gives a weekly pay of $1487.50

because 17.5*40(regular)+17.5*1.5*10(overtime) + 17.5*2*15(double-time) = 1487.50

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

Step: 3

blur-text-image

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

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

What is meant by 'Wealth Maximization ' ?

Answered: 1 week ago