diff options
| author | Jordan HarrisToovy <[email protected]> | 2021-10-18 02:04:03 -0700 |
|---|---|---|
| committer | Jordan HarrisToovy <[email protected]> | 2021-10-18 02:04:03 -0700 |
| commit | b7d15dd5dffe5523736fc87844e623633fd4300e (patch) | |
| tree | 439eda1044967a7770303be876a6cdd58a6b6981 /CST116F2021-Lab3 | |
| parent | Temporary push for backup (diff) | |
| download | cst116-lab3-jordanht-oit-master.tar.xz cst116-lab3-jordanht-oit-master.zip | |
Diffstat (limited to 'CST116F2021-Lab3')
3 files changed, 268 insertions, 8 deletions
diff --git a/CST116F2021-Lab3/CST116 Lab3 Console Output Harris-Toovy.txt b/CST116F2021-Lab3/CST116 Lab3 Console Output Harris-Toovy.txt new file mode 100644 index 0000000..6fa57c7 --- /dev/null +++ b/CST116F2021-Lab3/CST116 Lab3 Console Output Harris-Toovy.txt @@ -0,0 +1,224 @@ +This file contains the console output for trial runs of each program in the main C++ source document. + +7.2 - Learn by doing exercises #1 [Run 1]: + +Please enter the amout of money you have (in USD): +20000 +Do you have a checkings account (enter 0 for no, 1 for yes): +1 +Do you have a savings account (enter 0 for no, 1 for yes): +1 + + +Your account type is: Gold + +C:\Users\jorda\Source\Repos\cst116-lab3-JordanHT-OIT\CST116F2021-Lab3\Debug\CST116 Lab3 Harris-Toovy.exe (process 7232) 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 . . . + +7.2 - Learn by doing exercises #1 [Run 2]: + +Please enter the amout of money you have (in USD): +14000 +Do you have a checkings account (enter 0 for no, 1 for yes): +0 +Do you have a savings account (enter 0 for no, 1 for yes): +0 + + +Your account type is: Error + +C:\Users\jorda\Source\Repos\cst116-lab3-JordanHT-OIT\CST116F2021-Lab3\Debug\CST116 Lab3 Harris-Toovy.exe (process 11552) exited with code 1. +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 . . . + + + +7.4 - Learn by doing exercises #1 [Run 1]: + +Student Grade Program + -Main Menu- + +1. Enter name +2. Enter test scores +3. Display test scores +9. Exit + +Please enter your choice from the list above: 1 + +This is where you would enter a name if this was more then a menu! + +C:\Users\jorda\Source\Repos\cst116-lab3-JordanHT-OIT\CST116F2021-Lab3\Debug\CST116 Lab3 Harris-Toovy.exe (process 2936) 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 . . . + +7.4 - Learn by doing exercises #1 [Run 2]: + +Student Grade Program + -Main Menu- + +1. Enter name +2. Enter test scores +3. Display test scores +9. Exit + +Please enter your choice from the list above: 9 + +Goodbye + +C:\Users\jorda\Source\Repos\cst116-lab3-JordanHT-OIT\CST116F2021-Lab3\Debug\CST116 Lab3 Harris-Toovy.exe (process 9904) 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 . . . + + + +7.10 - Programing exercises #2 [Run 1]: + +Enter the interest rate (in percent) of the loan: 9.23 + +Enter the principal (in USD) of the loan: 675 + + + +The payment due for this billing cycle is 87.30 USD + +C:\Users\jorda\Source\Repos\cst116-lab3-JordanHT-OIT\CST116F2021-Lab3\Debug\CST116 Lab3 Harris-Toovy.exe (process 272) 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 . . . + +7.10 - Programing exercises #2 [Run 2]: + +Enter the interest rate (in percent) of the loan: 22 + +Enter the principal (in USD) of the loan: 350 + +Interest rate is too high + +C:\Users\jorda\Source\Repos\cst116-lab3-JordanHT-OIT\CST116F2021-Lab3\Debug\CST116 Lab3 Harris-Toovy.exe (process 5292) exited with code 1. +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 . . . + + + +8.2 - Learn by doing exercises #1: + +Enter an interger between 1 and 50: 37 +The even numbers between 37 and 0 (inclusive) are: +36 +34 +32 +30 +28 +26 +24 +22 +20 +18 +16 +14 +12 +10 +8 +6 +4 +2 +0 + +C:\Users\jorda\Source\Repos\cst116-lab3-JordanHT-OIT\CST116F2021-Lab3\Debug\CST116 Lab3 Harris-Toovy.exe (process 2792) 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 . . . + + + +8.3 - Learn by doing exercises #1 [Run 1]: + +Enter an interger between 1 and 50: 11 +The even numbers between 11 and 0 (inclusive) are: +10 +8 +6 +4 +2 +0 + +C:\Users\jorda\Source\Repos\cst116-lab3-JordanHT-OIT\CST116F2021-Lab3\Debug\CST116 Lab3 Harris-Toovy.exe (process 2416) 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 . . . + +8.3 - Learn by doing exercises #1 [Run 2]: + +Enter an interger between 1 and 50: -33 + + Invalid input +Enter an interger between 1 and 50: 75 + + Invalid input +Enter an interger between 1 and 50: 22 +The even numbers between 22 and 0 (inclusive) are: +22 +20 +18 +16 +14 +12 +10 +8 +6 +4 +2 +0 + +C:\Users\jorda\Source\Repos\cst116-lab3-JordanHT-OIT\CST116F2021-Lab3\Debug\CST116 Lab3 Harris-Toovy.exe (process 10712) 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 . . . + + + +8.4 - Learn by doing exercises #1: + +Enter the number of asignments: 4 + +Enter each score as a percent. + +Enter score 1 : 80 + +Enter score 2 : 86 + +Enter score 3 : 77.5 + +Enter score 4 : 93.25 + +The average score is: 84.1875 + +C:\Users\jorda\Source\Repos\cst116-lab3-JordanHT-OIT\CST116F2021-Lab3\Debug\CST116 Lab3 Harris-Toovy.exe (process 11956) 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 . . . + + + +8.10 - Programing exercises #3: + +Enter maximum positive integer for the Fibonacci sequence: 999 + +1 +1 +2 +2 +3 +5 +8 +13 +21 +34 +55 +89 +144 +233 +377 +610 +987 + + +C:\Users\jorda\Source\Repos\cst116-lab3-JordanHT-OIT\CST116F2021-Lab3\Debug\CST116 Lab3 Harris-Toovy.exe (process 8072) 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 . . . diff --git a/CST116F2021-Lab3/CST116 Lab3 Harris-Toovy.cpp b/CST116F2021-Lab3/CST116 Lab3 Harris-Toovy.cpp index dc999dc..3f3270a 100644 --- a/CST116F2021-Lab3/CST116 Lab3 Harris-Toovy.cpp +++ b/CST116F2021-Lab3/CST116 Lab3 Harris-Toovy.cpp @@ -1,4 +1,4 @@ -//Code by Jordan Harris-Toovy for OIT's CST116 course. October 2021 +//Code by Jordan Harris-Toovy for OIT's CST116 course lab 3. October 2021 #include <iostream> #include <iomanip> @@ -169,6 +169,7 @@ int main() //8.2 - Learn by doing exercises #1 +/* int main() { int max_value = -1; @@ -183,7 +184,7 @@ int main() return (1); } - cout << "The even numbers between " << max_value << " and 0 are: " << endl; + cout << "The even numbers between " << max_value << " and 0 (inclusive) are: " << endl; //Check if even, remove 1 if not if ((max_value % 2) != 0) @@ -199,6 +200,45 @@ int main() return (0); } +*/ + +//8.3 - Learn by doing exercises #1 + +/* +int main() +{ + int max_value = -1; + + while ((max_value < 1) || (max_value > 50)) + { + cout << "Enter an interger between 1 and 50: "; + cin >> max_value; + + //Alert user of invalid input + if ((max_value < 1) || (max_value > 50)) + { + cout << "\n Invalid input\n"; + } + } + + cout << "The even numbers between " << max_value << " and 0 (inclusive) are: " << endl; + + //Check if even, remove 1 if not + if ((max_value % 2) != 0) + { + max_value--; + } + + do + { + cout << max_value << endl; + max_value -= 2; + } + while (max_value >= 0); + + return (0); +} +*/ //8.4 - Learn by doing exercises #1 @@ -296,7 +336,7 @@ int main() * DISPLAY working_v3 */ -/* + int main() { unsigned long long max_val = 0, working_v1 = 1, working_v2 = 1, working_v3 = 2; @@ -322,5 +362,3 @@ int main() return (0); } -*/ - diff --git a/CST116F2021-Lab3/CST116 Lab3 Textual Work Harris-Toovy.txt b/CST116F2021-Lab3/CST116 Lab3 Textual Work Harris-Toovy.txt index 927750d..9e38c22 100644 --- a/CST116F2021-Lab3/CST116 Lab3 Textual Work Harris-Toovy.txt +++ b/CST116F2021-Lab3/CST116 Lab3 Textual Work Harris-Toovy.txt @@ -22,6 +22,4 @@ This file contains all work not applicable to being answered in code/output form 2) b *= (a * 2) 3) b++ 4) c %= 5 -5) b /= a - - +5) b /= a
\ No newline at end of file |