diff options
| author | CEOofOogaBooga <[email protected]> | 2022-09-29 15:56:16 -0700 |
|---|---|---|
| committer | CEOofOogaBooga <[email protected]> | 2022-09-29 15:56:16 -0700 |
| commit | 8bdd503b71b993f949c48c7e9e734959426f92c4 (patch) | |
| tree | 2967e27c93e0ebc729072d75febb523ea352e565 /Ch 5 Debugging Project | |
| parent | updates (diff) | |
| download | cst116-debugging--trinh--main.tar.xz cst116-debugging--trinh--main.zip | |
Diffstat (limited to 'Ch 5 Debugging Project')
| -rw-r--r-- | Ch 5 Debugging Project/CST115 Chp5 Lab0 Pseudo code.txt | 10 | ||||
| -rw-r--r-- | Ch 5 Debugging Project/CST116 LAB 0 Debugging Chp5.txt | 6 | ||||
| -rw-r--r-- | Ch 5 Debugging Project/Ch 5 Debugging Project.cpp | 21 |
3 files changed, 30 insertions, 7 deletions
diff --git a/Ch 5 Debugging Project/CST115 Chp5 Lab0 Pseudo code.txt b/Ch 5 Debugging Project/CST115 Chp5 Lab0 Pseudo code.txt new file mode 100644 index 0000000..c58e3f6 --- /dev/null +++ b/Ch 5 Debugging Project/CST115 Chp5 Lab0 Pseudo code.txt @@ -0,0 +1,10 @@ +under main +create and set money to 123.45F +create and set raise +output "you have $" +output money +output "enter percent raise" +set raise to input +set money to money * (1+raise) +output "after your raise you have $" +output money
\ No newline at end of file diff --git a/Ch 5 Debugging Project/CST116 LAB 0 Debugging Chp5.txt b/Ch 5 Debugging Project/CST116 LAB 0 Debugging Chp5.txt new file mode 100644 index 0000000..14de27d --- /dev/null +++ b/Ch 5 Debugging Project/CST116 LAB 0 Debugging Chp5.txt @@ -0,0 +1,6 @@ +You have $123.45 +Enter percent raise: 0.1 +After your raise you have $135.795 + +C:\Users\furyf\OneDrive\Desktop\Homework\CST Homework\Debugging Project Lab 0\Ch 5 Debugging Project\x64\Debug\Ch 5 Debugging Project.exe (process 17412) exited with code 0. +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 7ea8962..84f8ffe 100644 --- a/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp +++ b/Ch 5 Debugging Project/Ch 5 Debugging Project.cpp @@ -1,5 +1,10 @@ /********************************************************************
-* File: Chap_5_Debugging.cpp
+* Thomas Trinh
+* CST 116
+* Lab #0
+* IDE, Simple Program, GitHub
+*
+*File: Chap_5_Debugging.cpp
*
* General Instructions: Complete each step before proceeding to the
* next.
@@ -16,6 +21,7 @@ * 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?
+*EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
* 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.
@@ -24,7 +30,8 @@ * 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?
+* window. What was printed?
+* You have $123.45
* 11) Select Stop Debugging either from the Debug menu or from your
* toolbar.
*
@@ -37,12 +44,12 @@ * 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?
-* 7) Hover your mouse pointer over raise. What is its value?
-* 8) Step over the calculation. Notice the watch on money is now
+* 6) Look at your watch. What is the value of money? 12.3450003
+* 7) Hover your mouse pointer over raise. What is its value? 0.100000001
+* 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.
+* to increase our money? Stop debugging and fix the calculation.
*
* Debugging Exercise 3
*
@@ -78,7 +85,7 @@ int main() cout << "Enter percent raise: ";
cin >> raise;
- money = money * raise;
+ money = money * (1+raise);
cout << "After your raise you have $";
cout << money << endl;
|