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/CST116 Lab3 Harris-Toovy.cpp | |
| 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/CST116 Lab3 Harris-Toovy.cpp')
| -rw-r--r-- | CST116F2021-Lab3/CST116 Lab3 Harris-Toovy.cpp | 48 |
1 files changed, 43 insertions, 5 deletions
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); } -*/ - |