The following algorithm is designed to determine a grade for a course that consists of quizzes, homework,
Question:
The following algorithm is designed to determine a grade for a course that consists of quizzes, homework, and a final exam:
Step 1: Input course number and name.
Step 2: Input weighting factors for quizzes (WQ), homework (WH), and the final exam (WF).
Step 3: Input quiz grades and determine an average quiz grade (AQ).
Step 4: Input homework grades and determine an average homework grade (AH).
Step 5: If this course has a final grade, continue to step 6. If not, go to step 9.
Step 6: Input final exam grade (FE).
Step 7: Determine average grade AG according to
Step 8: Go to step 10.
Step 9: Determine average grade AG according to
Step 10: Print out course number, name, and average grade.
Step 11: Terminate computation.
(a) Write well-structured pseudo code to implement this algorithm.
(b) Write, debug, and document a structured computer program based on this algorithm. Test it using the following data to calculate a grade without the final exam and a grade with the final exam: WQ = 30; WH = 40; WF = 30; quizzes = 98, 95, 90, 60, 99; homework = 98, 95, 86, 100, 100, 77; and final exam = 91.