How to Answer Programming Questions (OCR GCSE Computer Science): Revision Note
Exam code: J277
How do I answer an OCR GCSE (9-1) Computer Science programming question?
Programming questions can appear in both papers
Paper 1 may include questions that test understanding and interpretation of algorithms and computational thinking principles
Paper 2 is the dedicated component for assessing the ability to actively design, write, test, and refine programs
Section A questions can be answered using either pseudocode, flowcharts, bullet points, OCR Exam Reference Language or a high-level programming language
Section B questions must be answered using either OCR Exam Reference Language or a high-level programming language
To attempt a programming question that requires the writing of a new program, you should always ask yourself the following five key questions:
What are the inputs?
What are the outputs?
What processes take place?
What constructs will I need to use?
Do I need to use subprograms?
Example 1
Question | |
---|---|
Charlie is developing an adding game. The rules of the game are:
Write an algorithm to play this game. [6 marks] | |
What are the inputs? What are the outputs? What processes take place? | |
| |
What constructs will I need to use? | |
| |
Do I need to use subprograms? | |
| |
Answer | |
Pseudocode | |
score = 0 for count = 1 to 3 num1 = random(1, 10) num2 = random(1, 10) ans = input("What is” +num1 + " + " + num2 + "?") if ans = num1 + num2 then score = score + 1 end if next count print("You scored " + score) |
Example 2
Question | |
---|---|
A program written in a high-level language is used to access data from a database. This program has a procedure, The procedure
Write the procedure You must use either:
[6 marks] | |
What are the inputs? What are the outputs? What processes take place? | |
Write the procedure | |
What constructs will I need to use? | |
| |
Do I need to use subprograms? | |
| |
Answer | |
Pseudocode | |
procedure SaveLogs(data, filename) logFile = open(filename) logFile.writeLine(data) logFile.close() endprocedure |
Unlock more, it's free!
Did this page help you?