Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main() {
- double workinghours, dependents, Overtime=0;
- double grossPay=0, netHometakePay=0,socialSecurityTax=0,fedaralTax=0,stateIncomeTax=0,unionDues=45.00;
- string ask;
- while (true) {
- cout<< "The total number of hours worked" <<endl;
- cin >> workinghours;
- cout << "The total number of dependents" << endl;
- cin >> dependents;
- if (workinghours > 35) {
- grossPay=(38.50*35)+((workinghours-35)*(38.50*1.5));
- }
- else {
- grossPay=workinghours*38.50;
- }
- cout << "The Total grosspay is " << grossPay << endl;
- socialSecurityTax=grossPay*0.12;
- cout<<"Total Social Security Tax is "<<socialSecurityTax<<endl;
- fedaralTax=grossPay*0.20;
- cout<<"Total Fedaral Income Tax is "<<fedaralTax<<endl;
- stateIncomeTax=grossPay*0.10;
- cout<<"Total State Income Tax is "<<stateIncomeTax<<endl;
- cout<<"Union Dues is "<<unionDues<<endl;
- if (dependents>=2) {
- grossPay=grossPay-100;
- }
- netHometakePay=grossPay-(socialSecurityTax+fedaralTax+stateIncomeTax+unionDues);
- cout << "The Total earning taken home is " << netHometakePay << endl;
- cout<<endl;
- cout << "continue the progtam?";
- cin >> ask;
- if (ask!="yes") {
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement