Advertisement
efeertas

Untitled

Mar 5th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.70 KB | None | 0 0
  1. //payroll calculator by Efe Ertas
  2.  
  3. #include <iostream>
  4. #include <cmath>
  5.  
  6. using namespace std;
  7.  
  8. int main ()
  9. {
  10.  
  11. float wage;
  12. float hour;
  13. float netpay;
  14. float grosspay;
  15.  
  16. cout << "---------------WELCOME TO PAYROL CALCULATOR---------------" << endl;
  17. cout << " " << endl;
  18.  
  19. //get the hourly wage from the user
  20. cout << "Please enter your hourly wage: "  << endl;
  21. cin >> wage;
  22. //get the number of hours
  23. cout << "Please enter the hours you worked: " << endl;
  24. cin>> hour;
  25. //calculate the grosspay
  26. grosspay = (wage*hour);
  27.  
  28. cout << "Your gross pay is  "  << grosspay << endl;
  29. //calculate netpay
  30. netpay = (grosspay)-(grosspay/100)*(15);
  31.  
  32. cout << "Your net pay is " << netpay << endl;
  33.  
  34. return 0;
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement