Advertisement
nazmul404

tanni

Jun 2nd, 2020
1,084
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.20 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4.  
  5. int main() {
  6. double workinghours, dependents, Overtime=0;
  7. double grossPay=0, netHometakePay=0,socialSecurityTax=0,fedaralTax=0,stateIncomeTax=0,unionDues=45.00;
  8. string ask;
  9. while (true) {
  10. cout<< "The total number of hours worked" <<endl;
  11. cin >> workinghours;
  12. cout << "The total number of dependents" << endl;
  13. cin >> dependents;
  14.  
  15. if (workinghours > 35) {
  16.     grossPay=(38.50*35)+((workinghours-35)*(38.50*1.5));
  17. }
  18. else {
  19.     grossPay=workinghours*38.50;
  20. }
  21.  
  22.  
  23.  
  24. cout << "The Total grosspay is " << grossPay << endl;
  25. socialSecurityTax=grossPay*0.12;
  26. cout<<"Total Social Security Tax is "<<socialSecurityTax<<endl;
  27. fedaralTax=grossPay*0.20;
  28. cout<<"Total Fedaral Income Tax is "<<fedaralTax<<endl;
  29. stateIncomeTax=grossPay*0.10;
  30. cout<<"Total State Income Tax is "<<stateIncomeTax<<endl;
  31. cout<<"Union Dues is "<<unionDues<<endl;
  32. if (dependents>=2) {
  33.     grossPay=grossPay-100;
  34. }
  35. netHometakePay=grossPay-(socialSecurityTax+fedaralTax+stateIncomeTax+unionDues);
  36. cout << "The Total earning taken home is " << netHometakePay << endl;
  37. cout<<endl;
  38.  
  39. cout << "continue the progtam?";
  40. cin >> ask;
  41. if (ask!="yes") {
  42.     break;
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement