aboutsummaryrefslogtreecommitdiff
path: root/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Ch 5 Debugging Project/Ch 5 Debugging Project.cpp')
-rw-r--r--Ch 5 Debugging Project/Ch 5 Debugging Project.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp
index 0f43db8..400970b 100644
--- a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp
+++ b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp
@@ -86,6 +86,9 @@
*
* 9) What happened to our money? I thought a raise was supposed
* to increase our money? Stop debugging and fix the calculation.
+* It asks for a % raise, though we entered .1
+* It then multiplies by that number which shows us one tenth of the value of our money, rather than applying a 10% raise.
+*
*/
/* Debugging Exercise 3
@@ -117,9 +120,12 @@ int main()
// Breakpoint 1
// Put a breakpoint on the following line
- cout << "Enter percent raise: ";
+ cout << "Enter percent raise as a whole number: ";
cin >> raise;
+ cout << "You have entered: " << raise << "%\n";
+ raise = 1 + (raise / 100);
+
money = money * raise;
cout << "After your raise you have $";