aboutsummaryrefslogtreecommitdiff
path: root/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp
diff options
context:
space:
mode:
authorDerek Preston <[email protected]>2022-10-01 19:32:01 -0700
committerDerek Preston <[email protected]>2022-10-01 19:32:01 -0700
commitf1209de93711ccdc7a10a083fdcd04ec8ac7da53 (patch)
tree057fb6b6c1520f5bebcf8702475014f258792b98 /Ch 5 Debugging Project/Ch 5 Debugging Project.cpp
parentCommit at Step 10 of Debug1 (diff)
downloadcst116-lab0-debugging-prestonderek-f1209de93711ccdc7a10a083fdcd04ec8ac7da53.tar.xz
cst116-lab0-debugging-prestonderek-f1209de93711ccdc7a10a083fdcd04ec8ac7da53.zip
Commit at 19:31 for save
Diffstat (limited to 'Ch 5 Debugging Project/Ch 5 Debugging Project.cpp')
-rw-r--r--Ch 5 Debugging Project/Ch 5 Debugging Project.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp
index 295944d..04475bd 100644
--- a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp
+++ b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp
@@ -73,11 +73,17 @@ int main()
// Breakpoint 1
// Put a breakpoint on the following line
- cout << "Enter percent raise: "; //Inserted breakpoint for step 1.
+ cout << "Enter percent raise above 1.0%: "; //Inserted breakpoint for step 1. //Added a rule for the users entered value to stop the raise from being below 1.0%
cin >> raise;
- //Step 10 when you step over you get "You have $123.45. Enter percent raise:"
- money = money * raise;
+ while (raise <= 1.0)
+ {
+ cout << "You must enter a number greater than 1.0";
+ cin >> "Enter percent raise above 1.0%";
+ }
+ money = money * raise;
+ //Step 10 when you step over you get "You have $123.45. Enter percent raise:"
+ //setting raise to .1 makes the value after the calculation 12.345.
cout << "After your raise you have $";
cout << money << endl;