Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. main()
  6. {
  7. int hours;
  8. int overtimeHours;
  9. int hourlyPay;
  10.  
  11. cin >> hours;
  12. cin >> hourlyPay;
  13.  
  14. int overtimeRate = 1.5 * hourlyPay;
  15. int overTimePay = overtimeHours * overtimeRate;
  16. int totalEarned = hours * hourlyPay;
  17.  
  18. cin >> hours;
  19. cin >> hourlyPay;
  20. if (hours > 40)
  21. {
  22. overtimeHours = hours - 40;
  23. overTimePay = overtimeHours * overtimeRate;
  24. cout<<"\n Total amount earned is: "<< totalEarned + overtimePay;
  25. }
  26.  
  27. else
  28. {
  29. cout<<"\nTotal amount earned is: ">> totalEarned endl;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement