aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk2
diff options
context:
space:
mode:
authorMatthew Strapp <msattr@gmail.com>2019-02-13 16:22:13 -0600
committerMatthew Strapp <msattr@gmail.com>2019-02-13 16:22:13 -0600
commit82124fd0bbf2a167445c2260f63a7ca90f412ff1 (patch)
treed8924384f91ec25a9df398567f975a120f8e753b /ee1301/wk2
parentPut comment in correct place (diff)
downloadhomework-82124fd0bbf2a167445c2260f63a7ca90f412ff1.tar
homework-82124fd0bbf2a167445c2260f63a7ca90f412ff1.tar.gz
homework-82124fd0bbf2a167445c2260f63a7ca90f412ff1.tar.bz2
homework-82124fd0bbf2a167445c2260f63a7ca90f412ff1.tar.lz
homework-82124fd0bbf2a167445c2260f63a7ca90f412ff1.tar.xz
homework-82124fd0bbf2a167445c2260f63a7ca90f412ff1.tar.zst
homework-82124fd0bbf2a167445c2260f63a7ca90f412ff1.zip
Fix using wrong variable in statement on line 30
Diffstat (limited to 'ee1301/wk2')
-rw-r--r--ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp b/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp
index 7e64bb8..2476b31 100644
--- a/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp
+++ b/ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp
@@ -27,7 +27,7 @@ int main () {
if (Hours > 40) { //Every hour over 40 constitutes as overtime
OT=Hours-40;
}
- if (Dependents >= 3) { //More than 3 dependents carries a fee
+ if (Dependents >= 3 && Hours > 0) { //More than 3 dependents carries a fee
Health=35;
}
GrossPay = Hours * 16.78 + OT * 16.78 * 1.5;