From 2492a7ea12b7ed5bebeadff276adba63478d3ddf Mon Sep 17 00:00:00 2001 From: prestonderek Date: Wed, 12 Oct 2022 14:04:42 -0700 Subject: Changed OR to AND statement. --- CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp index 2fc1f9e..4dd5591 100644 --- a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp +++ b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp @@ -59,7 +59,7 @@ int main() // Put a breakpoint on the following line if (age == 1) //made this an equality statement rather than making age equal to 1. cout << "First Birthday" << endl; - else if (age >= 12 || age <= 19) + else if (age >= 12 && age <= 19) //Exersize 2 with an age of 25 is still writing 'teenager' with this else if. The issue is || is an OR statement. We need an AND statement. cout << "Teenager" << endl; else if (age < 12) cout << "Child" << endl; -- cgit v1.2.3