//Code by Jordan Harris-Toovy for OIT's CST116 Lab 5, November 2021 //NOTE: When evaluating code, please keep in mind that global vars have been moved the header file. #include "Main_header.h" //10.5 LBD-Ex #1 /* int main(void) { float student_score[NUM_SCORES] = {0.0F}, class_avarage = 0.0F; char student_grade[NUM_SCORES] = {'X'}; int total_scores[NUM_GRADES] = { 0 }; for (int idx = 0; idx < NUM_SCORES; idx++) { cout << "Enter score #" << idx + 1 << " of " << NUM_SCORES << ": "; cin >> student_score[idx]; if (student_score[idx] >= 92.0F) { student_grade[idx] = 'A'; total_scores[0]++; } else if (student_score[idx] >= 84.0F) { student_grade[idx] = 'B'; total_scores[1]++; } else if (student_score[idx] >= 75.0F) { student_grade[idx] = 'C'; total_scores[2]++; } else if (student_score[idx] >= 65.0F) { student_grade[idx] = 'D'; total_scores[3]++; } else if (student_score[idx] >= 0.0F) { student_grade[idx] = 'F'; total_scores[4]++; } else { cout << endl << "Score error" << endl; return -1; } cout << "Score: " << student_score[idx] << " Grade: " << student_grade[idx] << endl; class_avarage += student_score[idx]; } class_avarage /= NUM_SCORES; cout << endl << "The average score is: " << class_avarage << "%" << endl; cout << "Distribution of achieved grades:" << endl << "A: " << total_scores[0] << endl << "B: " << total_scores[1] << endl << "C: " << total_scores[2] << endl << "D: " << total_scores[3] << endl << "F: " << total_scores[4] << endl; return 0; } */ //10.6 LBD-Ex #1 INCOMPLETE /* int main(void) { float student_score[NUM_SCORES] = { 0.0F }, class_avarage = 0.0F; char student_grade[NUM_SCORES] = { 'X' }; int total_scores[NUM_GRADES] = { 0 }; get_scores(student_score); grade_scores(student_score, student_grade); total_grades(student_grade, total_scores); class_avarage = average_scores(student_score); display_info(class_avarage, total_scores, student_grade, student_score); return 0; } */ //10.7 LBD-Ex #2 (Mislabeled as "9.5 LBD-Ex #2") /* int main(void) { char firstName[NAMELENGTHMAX]{}, lastName[NAMELENGTHMAX]{}, totalName[NAMELENGTHMAX * 2]{}; int firstSize = 0, lastSize = 0; getName(firstName, 0); getName(lastName, 1); firstSize = getStringSize(firstName); lastSize = getStringSize(lastName); for (int idx = 0; idx < firstSize; idx++) { totalName[idx] = firstName[idx]; } totalName[firstSize] = ','; totalName[firstSize + 1] = ' '; for (int idx = 0; idx < lastSize; idx++) { totalName[firstSize + 2 + idx] = lastName[idx]; } totalName[firstSize + 3 + lastSize] = '\0'; cout << "\nYour full name is: " << totalName <> num_compair; compair = string_compair_N(string_1, string_2, num_compair); if (compair) { cout << "\nThe first " << num_compair << " characters match." << endl; } else { cout << "\nThere is a mismatch within the fisrt " << num_compair << " characters." << endl; } return (0); } */