From 122fc34ed48fc20b0ab228e02dbc10ffa4f04e83 Mon Sep 17 00:00:00 2001 From: levidavis04 <114828884+levidavis04@users.noreply.github.com> Date: Mon, 10 Oct 2022 17:49:18 -0700 Subject: Add files via upload --- main.cpp | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 main.cpp (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..844b557 --- /dev/null +++ b/main.cpp @@ -0,0 +1,53 @@ +// +// main.cpp +// CST116-ch.5 debugging-Davis +// +// Levi Davis +// + +// 1) On the lines indicated in the code below, insert a breakpoint. +// 2) With the program not in debugging mode, start debugging by +// using the "Step Into" tool. +// 3) Click on the Watch1 tab. +// 4) With the cursor in the Name column type money and press enter. +// This adds a programmer defined watch on the variable money. +// 5) Step Into until you reach the first cout statement. With +// the current line being that cout statement, Step Into again. +// 6) What happened? Where are we now? What is all of this nasty +// looking code? +// 7) Remember, stepping into a predefined routine takes you to the +// code for that routine. If the debugger can't find the code it +// will show the assembly code for that routine. +// 8) How do we get out of this mess? Use the "Step Out" tool. +// 9) In Visual Studio you will be taken back to the same cout +// statement. Use the Step Over tool to take you to the next +// line. +// 10) Step over the next cout statement. Now look at the console +// window. What was printed? +// 11) Select Stop Debugging either from the Debug menu or from your +// toolbar. +#include +#include +using std::cout; +using std::cin; +using std::endl; + +int main() +{ + float money = 123.45F; + float raise; + + cout << "You have $"; + cout << money << endl; + + + cout << "Enter percent raise: "; + cin >> raise; + + money = money * raise; + + cout << "After your raise you have $"; + cout << money << endl; + + return 0; +} -- cgit v1.2.3