From 25131d257efdcf5a17bca0d81a711043cbe9f60b Mon Sep 17 00:00:00 2001 From: Musa Ahmed Date: Thu, 29 Sep 2022 16:30:27 -0700 Subject: answered the questions --- Ch 5 Debugging Project/CST11116-Lab0-Ahmed | 7 ------- Ch 5 Debugging Project/CST11116-Lab0-Ahmed.txt | 7 +++++++ Ch 5 Debugging Project/Ch 5 Debugging Project.cpp | 13 ++++++++++++- Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj | 2 +- .../Ch 5 Debugging Project.vcxproj.filters | 2 +- 5 files changed, 21 insertions(+), 10 deletions(-) delete mode 100644 Ch 5 Debugging Project/CST11116-Lab0-Ahmed create mode 100644 Ch 5 Debugging Project/CST11116-Lab0-Ahmed.txt diff --git a/Ch 5 Debugging Project/CST11116-Lab0-Ahmed b/Ch 5 Debugging Project/CST11116-Lab0-Ahmed deleted file mode 100644 index 9709ae9..0000000 --- a/Ch 5 Debugging Project/CST11116-Lab0-Ahmed +++ /dev/null @@ -1,7 +0,0 @@ -You have $123.45 -Enter percent raise: 0.1 -After your raise you have $135.795 - -C:\Users\macho\Source\Repos\cst116-lab0-debugging-M005A\Ch 5 Debugging Project\x64\Debug\CST116-Debugging-Ahmed.exe (process 15640) exited with code 0. -To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. -Press any key to close this window . . . \ No newline at end of file diff --git a/Ch 5 Debugging Project/CST11116-Lab0-Ahmed.txt b/Ch 5 Debugging Project/CST11116-Lab0-Ahmed.txt new file mode 100644 index 0000000..9709ae9 --- /dev/null +++ b/Ch 5 Debugging Project/CST11116-Lab0-Ahmed.txt @@ -0,0 +1,7 @@ +You have $123.45 +Enter percent raise: 0.1 +After your raise you have $135.795 + +C:\Users\macho\Source\Repos\cst116-lab0-debugging-M005A\Ch 5 Debugging Project\x64\Debug\CST116-Debugging-Ahmed.exe (process 15640) exited with code 0. +To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops. +Press any key to close this window . . . \ No newline at end of file diff --git a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp index c04cd17..f30123e 100644 --- a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp +++ b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp @@ -41,12 +41,23 @@ * 4) Enter the value .1 and press enter. * 5) Notice that the current line of execution is now at the * calculation. -* 6) Look at your watch. What is the value of money? +* 6) Look at your watch. What is the value of money? + + money 123.449997 float + * 7) Hover your mouse pointer over raise. What is its value? + + raise 0.100000001 float + * 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 * to increase our money? Stop debugging and fix the calculation. + + - The calculation only multiplies the money by the raise, + when it should actually be multiplying it by raise + 1. + Right now we are only getting the value that the money + shoudl be increases by. * * * Debugging Exercise 3 diff --git a/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj b/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj index b1784a0..09ec702 100644 --- a/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj +++ b/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj @@ -147,7 +147,7 @@ - + diff --git a/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj.filters b/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj.filters index dd2959d..dedc1e2 100644 --- a/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj.filters +++ b/Ch 5 Debugging Project/Ch 5 Debugging Project.vcxproj.filters @@ -28,7 +28,7 @@ Source Files - + Source Files -- cgit v1.2.3