Calculate the final numerical score and letter grade for the2074 course, and the current score and grade before the second testand final exam are taken. Also calculate best possible and worstgrades projected after Test2 and final exam taken.

For best score assume all remaining assessments (not provided orempty inputs) are 100%. For worst score assume all remainingassessments are 50%. Assume for best and worst scores that thereare a total of ten quizzes and ten weeks of Computer Lab Exercisesand Homework assignments. Assume every weekly Computer Lab has oneExercise, and that each weekly Homework assignment has two or threeproblems (same throughout the term). Each weekly Computer Lab isaveraged with the two or three weekly Homework problems for acombined CL/HW score. One test suite case is the followingscenario.

Scenario:https://canvas.vt.edu/files/10704711/download?download_frd=1

Opens in new tab

Stubs with function signatures for sub-functions, correspondingto the high level pseudo code and flow chart (green and orangelines/blocks) shown in class, are provided within the functiontemplate below. You may use these nested sub-functions (or not) asyou choose

******MATLAB** Please add comments when possible.Thank you

Function Save C Reset » MATLAB Documentation 1 function [Current_Letter Grade, Current_Numeric Score, Best Score, Worst Score] = HW3_Course Grade( Quizzes, QuizMax, CL_Scores, HW_Scores, Testi, Te 2 % Input 3 % Quizzes: Raw scores for each quiz (vector) 4 % QuizMax: Maximum score (# questions) for each quiz (vector) 5 % CL_Scores: Computer Lab Exercise Score for each week (vector) 6 % HW_Scores: Homework assignment scores for each week (matrix, w-by-3) w rows for each week by 3 columns for each problem per week Test1: First in-class test score (scalar) Test2: Second in-class test score (scalar) 10 % Final: Final exam score (scalar) 11 % 12 % HINT–Use isempty function to detect whether a test is missing. 14 %% Output 15 % Current_Letter_Grade: Character string of A-F +/- letter grade 16 % (1-by-2 matrix) 17 % Current_Numeric_Score: Numeric Grade Score on 100-point scale (scalar) 18 % Best Score: Best Possible Score for 100% on remaining work 19 % Worst Score: Worst Score, assuming 50% on remaining work %% Write your primary function code here. %% Sub-function to Average Quizzes function Quiz_Score = Quiz_Averageſ quizzes, maxima ) %% Input % quizzes: Raw score of # correct on tutorial & in-class quizzes (vector) % maxima: Maximum number of correct possible, i.e., # questions (vector) %% Output % Quiz_Score: Average of each week’s quiz percentage (scalar) end % Quiz_Score sub-function %% Sub-function to Average Computer Lab & Homework function CLHW_Score = CLAW_Average ( CL_Scores, HW_Scores) %% Input % CL_Scores: Computer Lab Exercise percentage correct (vector) % HW_Scores: Homework problem percentages (N-by-3 matrix) where N is the number of completed HW Assignments %% Output % CLHW_Score: Average over all weeks of assignments of the weekly Computer Lab Exercise averaged with Assigned Problems end % CLHW_Score sub-function %% Sub-function to Calculate Numeric Score for course function N = NumericScore(Scores, Weights) %% Input % Scores: Percentage Score for each assignment category (vector) % Weights: Percentage weighting factor for each Score (vector) %% Output % N: Percentage numeric score for course grade (scalar) end % NumericScore sub-function %% Sub-function to return letter grade character string function LetterGrades = CL2_LetterGrade( NumericGrades, GradeMap) % usage: LetterGrades = CL2_LetterGrade( NumericGrades, GradeMap ) %% Input % NumericGrades: Students’ single numeric score for the whole class (n-by-1 vector) one numeric grade for each student % GradeMap: Monotonically decreasing breakpoints (1-by-12 vector) %% Output % LetterGrades: string that holds the final letter grade (n-by-2 matrix) % The corresponding letter grade is assigned if NumericGrade is % greater than or equal to the GradeMap breakpoint entry. end % LetterGrades sub-function 88 % End of primary function 89 end Code to call your function 1 Quizzes = [8 6 9]; 2 QuizMax = [8 6 10]; CL_Scores = [100 100); 4 HW_Scores = [100, 100, 50 100, 100, 0]; Weights = [10, 25, 20, 20, 25]; [Final_Letter_Grade, Final_Numeric_Score] = … HW3_Course_Grade( Quizzes, QuizMax, CL_Scores, HW_Scores, … 75, 86, 90, Weights ) 10 Show transcribed image text Function Save C Reset » MATLAB Documentation 1 function [Current_Letter Grade, Current_Numeric Score, Best Score, Worst Score] = HW3_Course Grade( Quizzes, QuizMax, CL_Scores, HW_Scores, Testi, Te 2 % Input 3 % Quizzes: Raw scores for each quiz (vector) 4 % QuizMax: Maximum score (# questions) for each quiz (vector) 5 % CL_Scores: Computer Lab Exercise Score for each week (vector) 6 % HW_Scores: Homework assignment scores for each week (matrix, w-by-3) w rows for each week by 3 columns for each problem per week Test1: First in-class test score (scalar) Test2: Second in-class test score (scalar) 10 % Final: Final exam score (scalar) 11 % 12 % HINT–Use isempty function to detect whether a test is missing. 14 %% Output 15 % Current_Letter_Grade: Character string of A-F +/- letter grade 16 % (1-by-2 matrix) 17 % Current_Numeric_Score: Numeric Grade Score on 100-point scale (scalar) 18 % Best Score: Best Possible Score for 100% on remaining work 19 % Worst Score: Worst Score, assuming 50% on remaining work %% Write your primary function code here. %% Sub-function to Average Quizzes function Quiz_Score = Quiz_Averageſ quizzes, maxima ) %% Input % quizzes: Raw score of # correct on tutorial & in-class quizzes (vector) % maxima: Maximum number of correct possible, i.e., # questions (vector) %% Output % Quiz_Score: Average of each week’s quiz percentage (scalar) end % Quiz_Score sub-function %% Sub-function to Average Computer Lab & Homework function CLHW_Score = CLAW_Average ( CL_Scores, HW_Scores) %% Input % CL_Scores: Computer Lab Exercise percentage correct (vector) % HW_Scores: Homework problem percentages (N-by-3 matrix) where N is the number of completed HW Assignments %% Output % CLHW_Score: Average over all weeks of assignments of the weekly Computer Lab Exercise averaged with Assigned Problems end % CLHW_Score sub-function

%% Sub-function to Calculate Numeric Score for course function N = NumericScore(Scores, Weights) %% Input % Scores: Percentage Score for each assignment category (vector) % Weights: Percentage weighting factor for each Score (vector) %% Output % N: Percentage numeric score for course grade (scalar) end % NumericScore sub-function %% Sub-function to return letter grade character string function LetterGrades = CL2_LetterGrade( NumericGrades, GradeMap) % usage: LetterGrades = CL2_LetterGrade( NumericGrades, GradeMap ) %% Input % NumericGrades: Students’ single numeric score for the whole class (n-by-1 vector) one numeric grade for each student % GradeMap: Monotonically decreasing breakpoints (1-by-12 vector) %% Output % LetterGrades: string that holds the final letter grade (n-by-2 matrix) % The corresponding letter grade is assigned if NumericGrade is % greater than or equal to the GradeMap breakpoint entry. end % LetterGrades sub-function 88 % End of primary function 89 end Code to call your function 1 Quizzes = [8 6 9]; 2 QuizMax = [8 6 10]; CL_Scores = [100 100); 4 HW_Scores = [100, 100, 50 100, 100, 0]; Weights = [10, 25, 20, 20, 25]; [Final_Letter_Grade, Final_Numeric_Score] = … HW3_Course_Grade( Quizzes, QuizMax, CL_Scores, HW_Scores, … 75, 86, 90, Weights ) 10

## Expert Answer

Answer to Calculate the final numerical score and letter grade for the 2074 course, and the current score and grade before the sec…