aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevidavis04 <[email protected]>2022-10-10 17:49:18 -0700
committerGitHub <[email protected]>2022-10-10 17:49:18 -0700
commit122fc34ed48fc20b0ab228e02dbc10ffa4f04e83 (patch)
tree67fd0e2eab636d04e30e32f11e92eb659e38933c
parentSetting up GitHub Classroom Feedback (diff)
downloadcst116-ch5-debugging-levidavis04-122fc34ed48fc20b0ab228e02dbc10ffa4f04e83.tar.xz
cst116-ch5-debugging-levidavis04-122fc34ed48fc20b0ab228e02dbc10ffa4f04e83.zip
Add files via upload
-rw-r--r--Ch. 5 Pseudo-code.rtf19
-rw-r--r--Output.rtf18
-rw-r--r--main.cpp53
3 files changed, 90 insertions, 0 deletions
diff --git a/Ch. 5 Pseudo-code.rtf b/Ch. 5 Pseudo-code.rtf
new file mode 100644
index 0000000..87c0f11
--- /dev/null
+++ b/Ch. 5 Pseudo-code.rtf
@@ -0,0 +1,19 @@
+{\rtf1\ansi\ansicpg1252\cocoartf2639
+\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+{\*\expandedcolortbl;;}
+\margl1440\margr1440\vieww11520\viewh8400\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
+
+\f0\fs24 \cf0 Pseudo-Code\
+\
+Money = 123.45\
+Print \'93You have $\'94\
+Print \'93Enter percent raise: \'93\
+User input = raise\
+\
+Money = money * raise\
+\
+Print \'93After your raise you have << money <<\'93\
+\
+Money = 0} \ No newline at end of file
diff --git a/Output.rtf b/Output.rtf
new file mode 100644
index 0000000..4808306
--- /dev/null
+++ b/Output.rtf
@@ -0,0 +1,18 @@
+{\rtf1\ansi\ansicpg1252\cocoartf2639
+\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Menlo-Bold;\f2\fnil\fcharset0 Menlo-Regular;
+}
+{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red255\green255\blue255;}
+{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;\cssrgb\c100000\c100000\c100000\c0;}
+\margl1440\margr1440\vieww11520\viewh8400\viewkind0
+\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
+
+\f0\fs24 \cf0 Output:\cf2 \
+\pard\tx593\pardeftab593\pardirnatural\partightenfactor0
+
+\f1\b \cf2 \cb3 You have $123.45\
+Enter percent raise:
+\f2\b0 .10
+\f1\b \
+After your raise you have $12.345\
+Program ended with exit code: 0 \
+} \ No newline at end of file
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 <iostream>
+#include <iomanip>
+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;
+}