diff options
| author | Taylor Rogers <[email protected]> | 2022-10-08 14:30:11 -0700 |
|---|---|---|
| committer | Taylor Rogers <[email protected]> | 2022-10-08 14:30:11 -0700 |
| commit | 4084f1652ab41b263efd5c7777ee24e018a2563f (patch) | |
| tree | 1c0c3f240f8894f8dc0aead2e0d4d7325fe5472b | |
| parent | Answered Q6 (diff) | |
| download | cst116-ch7-debugging-taylorrog-4084f1652ab41b263efd5c7777ee24e018a2563f.tar.xz cst116-ch7-debugging-taylorrog-4084f1652ab41b263efd5c7777ee24e018a2563f.zip | |
Answered exercise 2 Q6
| -rw-r--r-- | .vs/cst116-ch7-debugging-Taylorrog/v17/.suo | bin | 24064 -> 25600 bytes | |||
| -rw-r--r-- | .vs/cst116-ch7-debugging-Taylorrog/v17/Browse.VC.db | bin | 15200256 -> 15200256 bytes | |||
| -rw-r--r-- | .vs/slnx.sqlite | bin | 331776 -> 331776 bytes | |||
| -rw-r--r-- | CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp | 11 |
4 files changed, 9 insertions, 2 deletions
diff --git a/.vs/cst116-ch7-debugging-Taylorrog/v17/.suo b/.vs/cst116-ch7-debugging-Taylorrog/v17/.suo Binary files differindex 5ec7d3e..592c0de 100644 --- a/.vs/cst116-ch7-debugging-Taylorrog/v17/.suo +++ b/.vs/cst116-ch7-debugging-Taylorrog/v17/.suo diff --git a/.vs/cst116-ch7-debugging-Taylorrog/v17/Browse.VC.db b/.vs/cst116-ch7-debugging-Taylorrog/v17/Browse.VC.db Binary files differindex a5ba7d4..bb81059 100644 --- a/.vs/cst116-ch7-debugging-Taylorrog/v17/Browse.VC.db +++ b/.vs/cst116-ch7-debugging-Taylorrog/v17/Browse.VC.db diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite Binary files differindex ea07ab0..3de3c9a 100644 --- a/.vs/slnx.sqlite +++ b/.vs/slnx.sqlite diff --git a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp index 8a7d023..10862be 100644 --- a/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp +++ b/CST116-Ch7-Debugging/CST116-Ch7-Debugging.cpp @@ -29,8 +29,15 @@ * 3) Step over the if statement. Execution of the program should
* continue on the else if statement.
* 4) Verify that 25 is still stored in age.
+*
+* Still there
+*
+*
* 5) Step over the else if.
* 6) Why is the program going to print "Teenager" for an age of 25?
+*
+* because the OR operator was used when it should be an AND
+*
* 7) Fix the problem and repeat Steps 1 � 5 to verify the
* problem was corrected.
* 8) Stop debugging.
@@ -61,9 +68,9 @@ int main() // Breakpoint 1
// Put a breakpoint on the following line
- if (age = 1)
+ if (age == 1)
cout << "First Birthday" << endl;
- else if (age >= 12 || age <= 19)
+ else if (age >= 12 && age <= 19)
cout << "Teenager" << endl;
else if (age < 12)
cout << "Child" << endl;
|