diff options
Diffstat (limited to 'CST116F2021-Lab5/CST116F2021-Lab5.cpp')
| -rw-r--r-- | CST116F2021-Lab5/CST116F2021-Lab5.cpp | 119 |
1 files changed, 107 insertions, 12 deletions
diff --git a/CST116F2021-Lab5/CST116F2021-Lab5.cpp b/CST116F2021-Lab5/CST116F2021-Lab5.cpp index e7591f7..fe1596f 100644 --- a/CST116F2021-Lab5/CST116F2021-Lab5.cpp +++ b/CST116F2021-Lab5/CST116F2021-Lab5.cpp @@ -1,20 +1,115 @@ -// CST116F2021-Lab5.cpp : This file contains the 'main' function. Program execution begins and ends there. -// +// File: CST116-Lab_5-Billingsley.cpp +// Summary: A compilation of all coding exercises in lab 5 +// Author: Logan Billingsley +// Date: 11/2/2021 +#include "CST116-lab5.h" + + // 9a -- 10.5 Learn by Doing Exercises +/* #include <iostream> +using namespace std; + +const int SIZE = 10; + +int main() +{ + float scores[SIZE]; + int A = 0, + B = 0, + C = 0, + D = 0, + F = 0; + + for (int i = 0; i < SIZE; i++) // Get scores + { + cout << "Please enter score " << i + 1 << ": "; + cin >> scores[i]; + cout << endl; + } + for (int i = 0; i < SIZE; i++) // Display scores and letter grade. + { + cout << "Score " << i + 1 << ": " << scores[i] << ' '; + if (scores[i] >= 92) + { + cout << "A\n\n"; + A++; + } + else if (scores[i] >= 84) + { + cout << "B\n\n"; + B++; + } + else if (scores[i] >= 75) + { + cout << "C\n\n"; + C++; + } + else if (scores[i] >= 65) + { + cout << "D\n\n"; + D++; + } + else + { + cout << "F\n\n"; + F++; + } + } + cout << "There were a total of: \n" + << A << " A's\n" + << B << " B's\n" + << C << " C's\n" + << D << " D's\n" + << F << " F's\n\n"; + return 0; +} +*/ + + // 9b -- 10.6 Learn by Doing Exercises +/* +int main() +{ + float scores[SIZE]; + int A = 0, + B = 0, + C = 0, + D = 0, + F = 0; + + GetScores(scores); + DisplayScores(scores, A, B, C, D, F); + DisplayTotals(A, B, C, D, F); + return 0; +} +*/ + + // 10a -- 10.7 Learn by Doing Exercies 2 +/* int main() { - std::cout << "Hello World!\n"; + char first[SIZE], + last[SIZE], + full[SIZE*3]; + + GetNames(first, last); + FullName(first, last, full); + PrintName(full); + + return 0; } +*/ -// Run program: Ctrl + F5 or Debug > Start Without Debugging menu -// Debug program: F5 or Debug > Start Debugging menu + // 10b -- 10.8 Exercies 7 +/* +int main() +{ + char string1[SIZE], + string2[SIZE]; -// Tips for Getting Started: -// 1. Use the Solution Explorer window to add/manage files -// 2. Use the Team Explorer window to connect to source control -// 3. Use the Output window to see build output and other messages -// 4. Use the Error List window to view errors -// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project -// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file + GetString1(string1); + GetString2(string2); + CompareStrings(string1, string2); +} +*/
\ No newline at end of file |