diff options
| author | Hannah Wu <[email protected]> | 2022-10-11 21:09:04 -0700 |
|---|---|---|
| committer | Hannah Wu <[email protected]> | 2022-10-11 21:09:04 -0700 |
| commit | 28585c759a375fff1b4246a17db97f29b0009546 (patch) | |
| tree | 72de2a38d3f4fb2b760379873e96323b887a69a9 /Ch 5 Debugging Project/Ch 5 Debugging Project.cpp | |
| parent | Deleted old files. Replaced old files. (diff) | |
| download | cst116-lab0-debugging-wu-main.tar.xz cst116-lab0-debugging-wu-main.zip | |
Added answers to top of program. Corrected program. Added output textfile. Added pseudocode text file.HEADmain
Diffstat (limited to 'Ch 5 Debugging Project/Ch 5 Debugging Project.cpp')
| -rw-r--r-- | Ch 5 Debugging Project/Ch 5 Debugging Project.cpp | 4 |
1 files changed, 3 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 6545e9b..4058c23 100644 --- a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp +++ b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp @@ -25,6 +25,7 @@ * line.
* 10) Step over the next cout statement. Now look at the console
* window. What was printed?
+* A: Nothing. After ignoring all the cout statements there is nothing printed.
* 11) Select Stop Debugging either from the Debug menu or from your
* toolbar.
*
@@ -43,6 +44,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.
+* A: Original calculation is money*raise. Change to money+(money*raise) to get the correct calculation.
*
* Debugging Exercise 3
*
@@ -76,7 +78,7 @@ int main() cout << "Enter percent raise: ";
cin >> raise;
- money = money * raise;
+ money = money + (money*raise);
cout << "After your raise you have $";
cout << money << endl;
|