From 28585c759a375fff1b4246a17db97f29b0009546 Mon Sep 17 00:00:00 2001 From: Hannah Wu Date: Tue, 11 Oct 2022 21:09:04 -0700 Subject: Added answers to top of program. Corrected program. Added output textfile. Added pseudocode text file. --- Ch 5 Debugging Project/Ch 5 Debugging Project.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (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 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; -- cgit v1.2.3