aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp
index 47a52c8..3014bd5 100644
--- a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp
+++ b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp
@@ -17,7 +17,7 @@
* 6) What happened? Where are we now? What is all of this nasty
* looking code?
*
-* -Background code routine that will execute the display-
+* -Background code subroutine that will execute the command in the line-
*
* 7) Remember, stepping into a predefined routine takes you to the
* code for that routine. If the debugger can't find the code it
@@ -28,6 +28,9 @@
* line.
* 10) Step over the next cout statement. Now look at the console
* window. What was printed?
+*
+* -After your raise you have $-
+*
* 11) Select Stop Debugging either from the Debug menu or from your
* toolbar.
*
@@ -41,11 +44,19 @@
* 5) Notice that the current line of execution is now at the
* calculation.
* 6) Look at your watch. What is the value of money?
+*
+* -$12.345-
+*
* 7) Hover your mouse pointer over raise. What is its value?
+*
+* -.1-
+*
* 8) Step over the calculation. Notice the watch on money is now
* red. This designates that the variable just changed its value.
* 9) What happened to our money? I thought a raise was supposed
* to increase our money? Stop debugging and fix the calculation.
+*
+* -The calculation is incorrect-
*
* Debugging Exercise 3
*
@@ -85,7 +96,7 @@ int main()
raise = raise * .01;
- money = money * (1 + raise);
+ money = money * (1+raise);
cout << "After your raise you have $";
cout << money << endl;