diff options
| author | JonCr <[email protected]> | 2022-10-05 17:54:53 -0700 |
|---|---|---|
| committer | JonCr <[email protected]> | 2022-10-05 17:54:53 -0700 |
| commit | 1a08cd5f8ffeb3e03c9a0bd0a2b8d543885796fd (patch) | |
| tree | f758b8f36fb15d9b82de9d663a2707bc9f6ec017 | |
| parent | Update (diff) | |
| download | cst116-ch5-debugging-cognitiveshadow-main.tar.xz cst116-ch5-debugging-cognitiveshadow-main.zip | |
| -rw-r--r-- | CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp | 4 | ||||
| -rw-r--r-- | CST116-ch5-Crombie-psuedo-code.txt | 13 | ||||
| -rw-r--r-- | CST116-ch5-Crombie.txt | 6 |
3 files changed, 22 insertions, 1 deletions
diff --git a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp index 4d09c03..932437e 100644 --- a/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp +++ b/CST116-Ch5-Debugging/CST116-Ch5-Debugging.cpp @@ -40,7 +40,9 @@ * 5) Notice that the current line of execution is now at the
* calculation.
* 6) Look at your watch. What is the value of money?
+* A) It is $125.449997
* 7) Hover your mouse pointer over raise. What is its value?
+* A) It is 0.100000001
* 8) Step over the calculation. Notice the watch on money is now
* red. This designates that the variable just changed its value.
* 9) What happened to our money? I thought a raise was supposed
@@ -78,7 +80,7 @@ int main() cout << "Enter percent raise: ";
cin >> raise;
- money = money * raise;
+ money = money * (1 + raise);
cout << "After your raise you have $";
cout << money << endl;
diff --git a/CST116-ch5-Crombie-psuedo-code.txt b/CST116-ch5-Crombie-psuedo-code.txt new file mode 100644 index 0000000..7523432 --- /dev/null +++ b/CST116-ch5-Crombie-psuedo-code.txt @@ -0,0 +1,13 @@ +Set money = 123.45 +Create "raise" variable + +Display current amount of money + "You have $[money]" + +Prompt user to enter raise amount + "Enter percent raise: " + +Add raise to current amount of money + +Display new amount of money + "After your raise you have $[money with raise]"
\ No newline at end of file diff --git a/CST116-ch5-Crombie.txt b/CST116-ch5-Crombie.txt new file mode 100644 index 0000000..5969cfb --- /dev/null +++ b/CST116-ch5-Crombie.txt @@ -0,0 +1,6 @@ +You have $123.45 +Enter percent raise: 0.1 +After your raise you have $135.795 + +C:\Users\JonCr\source\repos\cst116-ch5-debugging-CognitiveShadow\CST116-Ch5-Debugging\x64\Debug\CST116-Ch5-Debugging.exe (process 2716) exited with code 0. +Press any key to close this window . . . |