Gce Model Questions Vol1 2017 Computer Studies Question 8

Practice essay / theory question 8 from the 2017 Gce Model Questions Vol1 Computer Studies examination. This question covers Python Programming, Data Structures, Algorithm Design .

Gce Model Questions Vol1 2017 Computer Studies Essay / Theory
Topics: Python Programming Data Structures Algorithm Design
Question 8 GCE_MODEL_QUESTIONS_VOL1 • 2017 • COMPUTER_STUDIES • essay

A school wants to develop a simple Python program to manage the scores of a class of 20 students in three subjects: Mathematics, Physics and Chemistry. The program must store each student's name and their three scores (out of 100), compute the total and average for each student, determine the class highest total score, and display a sorted list of students in descending order of total score. The program should also flag any student whose average is below 50 as 'At risk'.

Question Parts

( a )
Write a clear, well‑structured Python function called `process_scores(data)` that takes a list of dictionaries (each dictionary contains keys: 'name', 'math', 'physics', 'chemistry') and returns a list of dictionaries where each dictionary includes the original data plus keys 'total', 'average', and 'status' ('At risk' or 'OK'). The returned list must be sorted in descending order of total score.
( b )
Using the function from part (a), show the exact output (including the order of the students and the values of total, average and status) for the following data set: ```python students = [ {'name': 'Ada', 'math': 78, 'physics': 85, 'chemistry': 90}, {'name': 'Bola', 'math': 45, 'physics': 55, 'chemistry': 48}, {'name': 'Chinedu', 'math': 92, 'physics': 88, 'chemistry': 95}, {'name': 'Dora', 'math': 66, 'physics': 70, 'chemistry': 72}, {'name': 'Emeka', 'math': 30, 'physics': 40, 'chemistry': 35} ] ``` Explain each step the program performs on the data to arrive at the output.
( c )
Identify and explain two potential logical errors that could arise if the programmer mistakenly uses integer division when calculating the average in Python 2 versus Python 3. Suggest a code modification that ensures correct average calculation regardless of Python version.

Detailed Solution & Marking Scheme

Get the step-by-step solution, key points required by examiners and detailed marking guidance through the Edcrib AI Tutor.

Reveal Answer

About This Question

This is Gce Model Questions Vol1 2017 Computer Studies Question 8. It is one of the essay questions from the 2017 Gce Model Questions Vol1 Computer Studies examination.

The question covers Python Programming, Data Structures, Algorithm Design .

Master the Exam!

You've seen a preview, but there are thousands more questions plus AI tutor to break down complex solutions.

Unlock Full Access Available for Android & Windows
Chat with Support