aboutsummaryrefslogtreecommitdiff
path: root/Ch 5 Debugging Project
diff options
context:
space:
mode:
authorjacobdw22 <[email protected]>2022-09-30 02:06:00 -0700
committerjacobdw22 <[email protected]>2022-09-30 02:06:00 -0700
commitdd08fa831ee0364567146928f463de405c80df6b (patch)
tree56950336ac7dd99908b3552809c394b479501727 /Ch 5 Debugging Project
parentsimple changes (diff)
downloadcst116-lab0-debugging-jacobdw22-dd08fa831ee0364567146928f463de405c80df6b.tar.xz
cst116-lab0-debugging-jacobdw22-dd08fa831ee0364567146928f463de405c80df6b.zip
simple changes
Diffstat (limited to 'Ch 5 Debugging Project')
-rw-r--r--Ch 5 Debugging Project/CST116-Debugging-Wilson.cpp5
-rw-r--r--Ch 5 Debugging Project/CST116-Debugging-Wilson.txt3
2 files changed, 7 insertions, 1 deletions
diff --git a/Ch 5 Debugging Project/CST116-Debugging-Wilson.cpp b/Ch 5 Debugging Project/CST116-Debugging-Wilson.cpp
index c088886..4ee870e 100644
--- a/Ch 5 Debugging Project/CST116-Debugging-Wilson.cpp
+++ b/Ch 5 Debugging Project/CST116-Debugging-Wilson.cpp
@@ -39,11 +39,14 @@
* 5) Notice that the current line of execution is now at the
* calculation.
* 6) Look at your watch. What is the value of money?
+* 123.449997
* 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 issue here was that the money was being multiplied by the fraction, rather than that occuring, and then being added back to the original money amount.
*
* Debugging Exercise 3
*
@@ -77,7 +80,7 @@ int main()
cout << "Enter percent raise: ";
cin >> raise;
- money = money * raise;
+ money = money + money * raise;
cout << "After your raise you have $";
cout << money << endl;
diff --git a/Ch 5 Debugging Project/CST116-Debugging-Wilson.txt b/Ch 5 Debugging Project/CST116-Debugging-Wilson.txt
new file mode 100644
index 0000000..2735c95
--- /dev/null
+++ b/Ch 5 Debugging Project/CST116-Debugging-Wilson.txt
@@ -0,0 +1,3 @@
+You have $123.45
+Enter percent raise: .1
+After your raise you have $135.795 \ No newline at end of file