A school is designing a program to decide whether a learner has passed a short online task. The learner passes only when their score is at least the named c...

Assessment: Computer Science 4CP0 | Paper 1 Mock 01 | Written Paper 1 Subject: Computer Science - 4CP0

Question 1 Report

A school is designing a program to decide whether a learner has passed a short online task. The learner passes only when their score is at least the named constant PASS_MARK and work has been submitted. The Boolean variable submitted stores either TRUE or FALSE. The flowchart represents the intended algorithm. A programmer will later implement the algorithm in Python, but the design currently uses language-independent pseudocode. The truth table represents the Boolean AND operation used in the decision.

StartInput score, submittedscore >= PASS_MARKAND submitted = TRUE?YesOutput PassNoOutput Retry© EAGLE BEACON GLOBAL
score conditionsubmittedcondition A AND B
FALSEFALSE__________
FALSETRUE__________
TRUEFALSE__________
TRUETRUE__________

(a) State the data type of submitted. [1]

(b) Complete the truth table. [2]

(c) Give the output when score is 50, PASS_MARK is 50 and submitted is FALSE. [2]

(d) Convert the pseudocode assignment score ← score + 1 into Python. [2]

(e) Identify the flowchart symbol used for the test of the two conditions and state its purpose. [2]

(f) Explain why using the named constant PASS_MARK, rather than repeatedly writing a number such as 50, improves maintainability. [3]

(g) Compare an assembler with a compiler. [3]

Answer Details

(a) submitted is a Boolean variable [1], since it stores only TRUE or FALSE.

(b)

Score conditionsubmittedA AND B
FALSEFALSEFALSE
FALSETRUEFALSE
TRUEFALSEFALSE
TRUETRUETRUE

AND is true only when both inputs are true [2].

(c) The score condition \(50\geq50\) is true, but submitted is false. True AND false is false, so the output is Retry [2].

(d) In Python, write score = score + 1 [2].

(e) The test uses a decision/diamond symbol. It tests a condition and selects a route according to whether the result is true or false [2].

(f) PASS_MARK stores the value in one clearly named location. If the pass mark changes, it is changed once rather than at every occurrence of 50. The name also makes its purpose clear and reduces inconsistent edits [3].

(g) An assembler translates assembly-language mnemonics into machine code, usually with a close one-to-one correspondence. A compiler translates a high-level language into object/machine code; one high-level statement can require several machine instructions, so compilation is more complex [3].

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