Read the information below about a language-learning app. The app chooses a new word for each player by calling pickWord(level). The function selects a word...

Assessment: Computer Science 9210 | Paper 1 Mock 01 | Programming (on-screen) Subject: Computer Science - 9210

Question 1 Report

Read the information below about a language-learning app. The app chooses a new word for each player by calling pickWord(level). The function selects a word from the correct list and returns it. Another procedure, showHint(word), displays the first and last letters of that returned word. The developer uses meaningful subroutine names so that another programmer can understand the main program without reading every command inside the subroutines. A fault report says that a level 3 player is sometimes given a word from level 1.

(a) Explain how meaningful names such as pickWord and showHint improve the readability of code. [2]
(b) Explain which subroutine should be investigated first for the reported fault. [1]

Answer Details

(a) Meaningful names state the purpose of each block: pickWord selects a word, while showHint displays a hint. A programmer can therefore follow the main program without inspecting every command inside each subroutine, making maintenance easier. [2]

(b) Investigate pickWord(level) first, because it selects the word list and returns the chosen word. It is the subroutine responsible for choosing a level-appropriate word. [1]

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning