diff options
| author | Musa Ahmed <[email protected]> | 2022-09-29 16:16:21 -0700 |
|---|---|---|
| committer | Musa Ahmed <[email protected]> | 2022-09-29 16:16:21 -0700 |
| commit | 613c8507bbdc79919b979059e03cf6b38d725a00 (patch) | |
| tree | 5733d9a3056024b29dd0a775416ccfc4516e3ef7 | |
| parent | Merge branch 'main' of https://github.com/CST116/cst116-lab0-debugging-M005A (diff) | |
| download | cst116-lab0-debugging-m005a-613c8507bbdc79919b979059e03cf6b38d725a00.tar.xz cst116-lab0-debugging-m005a-613c8507bbdc79919b979059e03cf6b38d725a00.zip | |
fixed the code
| -rw-r--r-- | Ch 5 Debugging Project/Ch 5 Debugging Project.cpp | 9 | ||||
| -rw-r--r-- | Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj | 1 |
2 files changed, 8 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;
diff --git a/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj b/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj index e3aae76..53ad340 100644 --- a/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj +++ b/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj @@ -24,6 +24,7 @@ <ProjectGuid>{57683855-4fb5-44ec-a27a-69826948f323}</ProjectGuid>
<RootNamespace>Ch5DebuggingProject</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
+ <ProjectName>CST116-Debugging-Ahmed</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|