The pay of an hourly worker is calculated by multiplying the hours worked by the hourly rate—up to 40 hours;

The pay of an hourly worker is calculated by multiplying the hours worked by the hourly rate—up to 40 hours;

LANGUAGE:  C++

CHALLENGE:

The pay of an hourly worker is calculated by multiplying the hours worked by the hourly rate—up to 40 hours;
any hours worked beyond 40 are paid at time-and-a-half (one and a half times the hourly rate).
Given the variables hours, rate, and pay have already been declared and assigned values, write a fragment of code (one or more statements) that assigns to pay the proper value, taking into account time-and-a-half.
(basic arithmetic, basic conditional)

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level