diff options
author | Matthew Strapp <msattr@gmail.com> | 2019-02-13 14:26:33 -0600 |
---|---|---|
committer | Matthew Strapp <msattr@gmail.com> | 2019-02-13 14:26:33 -0600 |
commit | 8448b849587e58ef64e5bc6a65816bed2afed005 (patch) | |
tree | df445df0d7b12730756a1f04bb23948488e81491 /ee1301/wk2/lab2 | |
parent | Finish calculator (diff) | |
download | homework-8448b849587e58ef64e5bc6a65816bed2afed005.tar homework-8448b849587e58ef64e5bc6a65816bed2afed005.tar.gz homework-8448b849587e58ef64e5bc6a65816bed2afed005.tar.bz2 homework-8448b849587e58ef64e5bc6a65816bed2afed005.tar.lz homework-8448b849587e58ef64e5bc6a65816bed2afed005.tar.xz homework-8448b849587e58ef64e5bc6a65816bed2afed005.tar.zst homework-8448b849587e58ef64e5bc6a65816bed2afed005.zip |
Finish assigned part
Diffstat (limited to '')
-rw-r--r-- | ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp b/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp new file mode 100644 index 0000000..9ed4bb0 --- /dev/null +++ b/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp @@ -0,0 +1,34 @@ +#include <iostream> +#include <iomanip> +using namespace std; + +int main () { + int dependents, hours; + int OT = 0; int Health = 0; + double SSI, MN, Fed, GroPay, NetPay; + cout << "How many hours did you work this week?: "; + cin >> hours; + cout << "How many dependents do you have?: "; + cin >> dependents; + if (hours > 40) { + OT=hours-40; + } + if (dependents >= 3) { + Health=35; + } + GroPay = hours * 16.78 + OT * 16.78 * 1.5; + SSI = GroPay * 0.06; + Fed = GroPay * 0.14; + MN = GroPay * .05; + NetPay = GroPay-SSI-Fed-MN-Health-10; //$10 union dues + + cout << fixed << setprecision(2) << "Your gross (before withholdings) pay is $" << GroPay << "." << endl + << "Social Security withholding: $" << SSI << endl + << "Federal income tax withholding: $" << Fed << endl + << "State income tax withholding: $" << MN << endl + << "Union Dues: $10" << endl + << "Medical cost: $" << Health << endl //<< endl + + << "Your net (after witholdings) pay is $" << NetPay << "." << endl; +} +//cout << fixed << setprecision(2) |