From 14f2c22168074279f1d6242f75741e8e348c3d92 Mon Sep 17 00:00:00 2001 From: Morgan Cyrus Date: Fri, 7 Oct 2022 21:02:56 -0700 Subject: Step 2.9 complete. Math and input fixed. --- Ch 5 Debugging Project/Ch 5 Debugging Project.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Ch 5 Debugging Project/Ch 5 Debugging Project.cpp') 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 $"; -- cgit v1.2.3