Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- main()
- {
- int hours;
- int overtimeHours;
- int hourlyPay;
- cin >> hours;
- cin >> hourlyPay;
- int overtimeRate = 1.5 * hourlyPay;
- int overTimePay = overtimeHours * overtimeRate;
- int totalEarned = hours * hourlyPay;
- cin >> hours;
- cin >> hourlyPay;
- if (hours > 40)
- {
- overtimeHours = hours - 40;
- overTimePay = overtimeHours * overtimeRate;
- cout<<"\n Total amount earned is: "<< totalEarned + overtimePay;
- }
- else
- {
- cout<<"\nTotal amount earned is: ">> totalEarned endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement