aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp
diff options
context:
space:
mode:
authorRossTheRoss <msattr@gmail.com>2019-06-25 17:55:13 -0500
committerRossTheRoss <msattr@gmail.com>2019-06-25 17:55:13 -0500
commit6c83506cb44b1d20f66df404f0b6468b0e291b6b (patch)
tree8e0475edc2891741862bc9b63844600bdebe6936 /ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp
parentM E A N I N G F U L C O M M E N T S (diff)
downloadhomework-6c83506cb44b1d20f66df404f0b6468b0e291b6b.tar
homework-6c83506cb44b1d20f66df404f0b6468b0e291b6b.tar.gz
homework-6c83506cb44b1d20f66df404f0b6468b0e291b6b.tar.bz2
homework-6c83506cb44b1d20f66df404f0b6468b0e291b6b.tar.lz
homework-6c83506cb44b1d20f66df404f0b6468b0e291b6b.tar.xz
homework-6c83506cb44b1d20f66df404f0b6468b0e291b6b.tar.zst
homework-6c83506cb44b1d20f66df404f0b6468b0e291b6b.zip
Do a thing:
Diffstat (limited to 'ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp')
-rw-r--r--ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp100
1 files changed, 50 insertions, 50 deletions
diff --git a/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp b/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp
index f0689d4..d87f156 100644
--- a/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp
+++ b/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp
@@ -1,50 +1,50 @@
-/*
-Date: 13 Feb 2019
-Name: Matthew Strapp
-Student ID number: 5449340
-Course number: EE1301
-Term: Spring 2019
-Lab/assignment number: Workout
-Short Program Description: Pay Stub Calculator
-*/
-
-#include <iostream>
-#include <iomanip>
-using namespace std;
-
-int main () {
- int Dependents, Hours;
- int OT = 0, Health = 0, Union =0; //Set values to zero to prevent problems
- double SocSec, State, Fed, GrossPay, NetPay;
- cout << "How many hours did you work this week?: ";
- cin >> Hours;
- if (Hours < 0) {
- cout << "Invalid option!" << endl;
- return 2;
- }
- cout << "How many dependents do you have?: ";
- cin >> Dependents;
- if (Hours > 40) { //Every hour over 40 constitutes as overtime
- OT=Hours-40;
- }
- if (Dependents >= 3 && Hours > 0) { //More than 3 dependents carries a fee
- Health=35;
- }
- GrossPay = Hours * 16.78 + OT * 16.78 * 1.5;
- SocSec = GrossPay * 0.06;
- Fed = GrossPay * 0.14;
- State = GrossPay * .05;
- if (GrossPay>0){
- Union=10;
- }
- NetPay = GrossPay - SocSec - Fed - State - Health - Union;
- cout << fixed << setprecision(2) << endl << "Your gross (before withholdings) pay is $" << GrossPay << "." << endl
- << "Social Security withholding: $" << SocSec << endl
- << "Federal income tax withholding: $" << Fed << endl
- << "State income tax withholding: $" << State << endl
- << "Union Dues: $" << Union << endl
- << "Medical cost: $" << Health << endl
-
- << "Your net (after witholdings) pay is $" << NetPay << "." << endl;
-
-}
+/*
+Date: 13 Feb 2019
+Name: Matthew Strapp
+Student ID number: 5449340
+Course number: EE1301
+Term: Spring 2019
+Lab/assignment number: Workout
+Short Program Description: Pay Stub Calculator
+*/
+
+#include <iostream>
+#include <iomanip>
+using namespace std;
+
+int main () {
+ int Dependents, Hours;
+ int OT = 0, Health = 0, Union =0; //Set values to zero to prevent problems
+ double SocSec, State, Fed, GrossPay, NetPay;
+ cout << "How many hours did you work this week?: ";
+ cin >> Hours;
+ if (Hours < 0) {
+ cout << "Invalid option!" << endl;
+ return 2;
+ }
+ cout << "How many dependents do you have?: ";
+ cin >> Dependents;
+ if (Hours > 40) { //Every hour over 40 constitutes as overtime
+ OT=Hours-40;
+ }
+ if (Dependents >= 3 && Hours > 0) { //More than 3 dependents carries a fee
+ Health=35;
+ }
+ GrossPay = Hours * 16.78 + OT * 16.78 * 1.5;
+ SocSec = GrossPay * 0.06;
+ Fed = GrossPay * 0.14;
+ State = GrossPay * .05;
+ if (GrossPay>0){
+ Union=10;
+ }
+ NetPay = GrossPay - SocSec - Fed - State - Health - Union;
+ cout << fixed << setprecision(2) << endl << "Your gross (before withholdings) pay is $" << GrossPay << "." << endl
+ << "Social Security withholding: $" << SocSec << endl
+ << "Federal income tax withholding: $" << Fed << endl
+ << "State income tax withholding: $" << State << endl
+ << "Union Dues: $" << Union << endl
+ << "Medical cost: $" << Health << endl
+
+ << "Your net (after witholdings) pay is $" << NetPay << "." << endl;
+
+}