diff options
author | Matthew Strapp <msattr@gmail.com> | 2019-02-13 15:42:53 -0600 |
---|---|---|
committer | Matthew Strapp <msattr@gmail.com> | 2019-02-13 15:42:53 -0600 |
commit | 123ca503b1489a4fde7bdfa88d6044fa09500eb5 (patch) | |
tree | 805df12606004623747e4d435d38fd42f4686e1d | |
parent | Fix meaningful comments (diff) | |
download | homework-123ca503b1489a4fde7bdfa88d6044fa09500eb5.tar homework-123ca503b1489a4fde7bdfa88d6044fa09500eb5.tar.gz homework-123ca503b1489a4fde7bdfa88d6044fa09500eb5.tar.bz2 homework-123ca503b1489a4fde7bdfa88d6044fa09500eb5.tar.lz homework-123ca503b1489a4fde7bdfa88d6044fa09500eb5.tar.xz homework-123ca503b1489a4fde7bdfa88d6044fa09500eb5.tar.zst homework-123ca503b1489a4fde7bdfa88d6044fa09500eb5.zip |
Fix sneaky
-rw-r--r-- | ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp b/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp index 431f11c..048e1b1 100644 --- a/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp +++ b/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp @@ -13,7 +13,7 @@ Short Program Description: Pay Stub Calculator using namespace std; int main () { - int Dependents, Hours; + int Dependents, Hours, Union; int OT = 0; int Health = 0; //Set values to zero to prevent problems double SocSec, State, Fed, GrossPay, NetPay; cout << "How many hours did you work this week?: "; @@ -30,8 +30,10 @@ int main () { SocSec = GrossPay * 0.06; Fed = GrossPay * 0.14; State = GrossPay * .05; - NetPay = GrossPay-SocSec-Fed-State-Health-10; //$10 union dues are constant - + if (GrossPay>0){ + Union=10; + } + NetPay = GrossPay-SocSec-Fed-State-Health-Union; //$10 union dues are constant cout << fixed << setprecision(2) << "Your gross (before withholdings) pay is $" << GrossPay << "." << endl << "Social Security withholding: $" << SocSec << endl << "Federal income tax withholding: $" << Fed << endl |