diff options
author | Matthew Strapp <msattr@gmail.com> | 2019-02-13 15:39:19 -0600 |
---|---|---|
committer | Matthew Strapp <msattr@gmail.com> | 2019-02-13 15:39:19 -0600 |
commit | fff3f3f155f0624c1fcd38db8ef19d9a85464891 (patch) | |
tree | 8b8ba2e5f4bf7b2cf68e0eae98b0511f6b5ded24 /ee1301 | |
parent | Fix spacing again (diff) | |
download | homework-fff3f3f155f0624c1fcd38db8ef19d9a85464891.tar homework-fff3f3f155f0624c1fcd38db8ef19d9a85464891.tar.gz homework-fff3f3f155f0624c1fcd38db8ef19d9a85464891.tar.bz2 homework-fff3f3f155f0624c1fcd38db8ef19d9a85464891.tar.lz homework-fff3f3f155f0624c1fcd38db8ef19d9a85464891.tar.xz homework-fff3f3f155f0624c1fcd38db8ef19d9a85464891.tar.zst homework-fff3f3f155f0624c1fcd38db8ef19d9a85464891.zip |
Meaningful comments
Diffstat (limited to 'ee1301')
-rw-r--r-- | ee1301/wk2/lab2/calc.cpp | 10 | ||||
-rw-r--r-- | ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/ee1301/wk2/lab2/calc.cpp b/ee1301/wk2/lab2/calc.cpp index f2e0e87..f9925b0 100644 --- a/ee1301/wk2/lab2/calc.cpp +++ b/ee1301/wk2/lab2/calc.cpp @@ -7,20 +7,20 @@ int main () { cout << "Enter an equation: "; cin >> a >> op >> b; cout << a << op << b << " = "; - - if (op=='+'){ + + if (op=='+'){ //Addition cout << a + b; } - if (op=='-'){ + if (op=='-'){ //Subtraction cout << a - b; } - if (op=='*'){ + if (op=='*'){ //Multiplication cout << a * b; } - if (op=='/'){ + if (op=='/'){ //Division cout << a / b; } diff --git a/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp b/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp index 066d16a..7afd48e 100644 --- a/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp +++ b/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp @@ -20,10 +20,10 @@ int main () { cin >> Hours; cout << "How many dependents do you have?: "; cin >> Dependents; - if (Hours > 40) { - OT=Hours-40; //Overtime pay is time-and-a-half + if (Hours > 40) { //Every hour over 40 constitutes as overtime + OT=Hours-40; } - if (Dependents >= 3) { + if (Dependents >= 3) { //More than 3 dependents carries a fee Health=35; } GrossPay = Hours * 16.78 + OT * 16.78 * 1.5; |