diff options
Diffstat (limited to 'CST116-Ch5-Debugging')
| -rw-r--r-- | CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp index 4d09c03..932437e 100644 --- a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp +++ b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp @@ -40,7 +40,9 @@ * 5) Notice that the current line of execution is now at the
* calculation.
* 6) Look at your watch. What is the value of money?
+* A) It is $125.449997
* 7) Hover your mouse pointer over raise. What is its value?
+* A) It is 0.100000001
* 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
@@ -78,7 +80,7 @@ int main() cout << "Enter percent raise: ";
cin >> raise;
- money = money * raise;
+ money = money * (1 + raise);
cout << "After your raise you have $";
cout << money << endl;
|