diff options
| author | Morgan Cyrus <[email protected]> | 2022-10-07 21:02:56 -0700 |
|---|---|---|
| committer | Morgan Cyrus <[email protected]> | 2022-10-07 21:02:56 -0700 |
| commit | 14f2c22168074279f1d6242f75741e8e348c3d92 (patch) | |
| tree | 0cecd350ccd8456aea2d430acadb8611093718a2 /Ch 5 Debugging Project/Ch 5 Debugging Project.cpp | |
| parent | Finished Exercise 2 Step 8 (diff) | |
| download | cst116-ch5-debugging-cyrus-14f2c22168074279f1d6242f75741e8e348c3d92.tar.xz cst116-ch5-debugging-cyrus-14f2c22168074279f1d6242f75741e8e348c3d92.zip | |
Step 2.9 complete. Math and input fixed.
Diffstat (limited to 'Ch 5 Debugging Project/Ch 5 Debugging Project.cpp')
| -rw-r--r-- | Ch 5 Debugging Project/Ch 5 Debugging Project.cpp | 8 |
1 files changed, 7 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 0f43db8..400970b 100644 --- a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp +++ b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp @@ -86,6 +86,9 @@ *
* 9) What happened to our money? I thought a raise was supposed
* to increase our money? Stop debugging and fix the calculation.
+* It asks for a % raise, though we entered .1
+* It then multiplies by that number which shows us one tenth of the value of our money, rather than applying a 10% raise.
+*
*/
/* Debugging Exercise 3
@@ -117,9 +120,12 @@ int main() // Breakpoint 1
// Put a breakpoint on the following line
- cout << "Enter percent raise: ";
+ cout << "Enter percent raise as a whole number: ";
cin >> raise;
+ cout << "You have entered: " << raise << "%\n";
+ raise = 1 + (raise / 100);
+
money = money * raise;
cout << "After your raise you have $";
|