aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp
diff options
context:
space:
mode:
authorJoe Traver <[email protected]>2022-10-10 18:27:06 -0700
committerJoe Traver <[email protected]>2022-10-10 18:27:06 -0700
commitc3b7b6ee3f2b7996f80f06cd2d4606b1931c1fce (patch)
treed4b55644a096dc2a13ff5053913c98ec9b7ac463 /CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp
parentProgram Sample (diff)
downloadcst116-ch5-debugging-joetraver30-c3b7b6ee3f2b7996f80f06cd2d4606b1931c1fce.tar.xz
cst116-ch5-debugging-joetraver30-c3b7b6ee3f2b7996f80f06cd2d4606b1931c1fce.zip
Questions answered and program complete
Diffstat (limited to 'CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp')
-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;