From 613c8507bbdc79919b979059e03cf6b38d725a00 Mon Sep 17 00:00:00 2001 From: Musa Ahmed Date: Thu, 29 Sep 2022 16:16:21 -0700 Subject: fixed the code --- Ch 5 Debugging Project/Ch 5 Debugging Project.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (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 0b5f307..7d6c472 100644 --- a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp +++ b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp @@ -15,7 +15,7 @@ * 5) Step Into until you reach the first cout statement. With * the current line being that cout statement, Step Into again. * 6) What happened? Where are we now? What is all of this nasty -* looking code? +* looking code? * 7) Remember, stepping into a predefined routine takes you to the * code for that routine. If the debugger can't find the code it * will show the assembly code for that routine. @@ -46,6 +46,7 @@ * 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. +* * * Debugging Exercise 3 * @@ -60,6 +61,8 @@ * ********************************************************************/ +// Name: Musa Ahmed, Course: CST116, Lab # 0, Learn how to debug + #include #include using std::cout; @@ -70,6 +73,7 @@ int main() { float money = 123.45F; float raise; + cout << "You have $"; cout << money << endl; @@ -79,7 +83,8 @@ int main() cout << "Enter percent raise: "; cin >> raise; - money = money * raise; + money = (money * (raise + 1)); + cout << "After your raise you have $"; cout << money << endl; -- cgit v1.2.3