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.cpp9
1 files changed, 7 insertions, 2 deletions
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 <iostream>
#include <iomanip>
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;