From 82124fd0bbf2a167445c2260f63a7ca90f412ff1 Mon Sep 17 00:00:00 2001 From: Matthew Strapp Date: Wed, 13 Feb 2019 16:22:13 -0600 Subject: Fix using wrong variable in statement on line 30 --- ee1301/wk2/lab2/strap012_lab2_pay_stub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ee1301') 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; -- cgit v1.2.3