From fde16d3ac69167be24b5ed75a1fc61dd38e87b09 Mon Sep 17 00:00:00 2001 From: prestonderek Date: Sat, 1 Oct 2022 21:10:14 -0700 Subject: Commit for the addition of While loop --- Ch 5 Debugging Project/Ch 5 Debugging Project.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Ch 5 Debugging Project/Ch 5 Debugging Project.cpp') diff --git a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp index 04475bd..f5e6e86 100644 --- a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp +++ b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp @@ -75,10 +75,11 @@ int main() // Put a breakpoint on the following line 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; - while (raise <= 1.0) + while (raise <= 1.0) //I added this while loop to combat the issue of inserting a raise that either keeps the money at the current value or decreases it. This was for step 9 Debug 2 { - cout << "You must enter a number greater than 1.0"; - cin >> "Enter percent raise above 1.0%"; + cout << "You must enter a number greater than 1.0" << endl; + cout << "Enter percent raise above 1.0%: "; + cin >> raise; } money = money * raise; -- cgit v1.2.3