Computer Science 15 Mark Question Bank
Computer Science 15 Mark Question Bank
c) Draw a logic circuit for the un-simplified logic expression. Each logic gate must have a
maximum of two inputs.
[6]
11 A times table test will be set up. Before using the test, the user can set the times table to be tested and
the number of questions to be asked. The times tables can be any whole number between 2 and 12
inclusive. The number of questions can be between 5 and 10 inclusive. No questions can be the same in
any test. The name of the user should be displayed with all messages and prompts.
Write and test a program that meets the following requirements:
o Sets up the starting conditions for the test
o During the test:
o displays each question with the question number
o checks if the answer input is correct and displays the right answer if the answer input was
wrong
o adds one to the user’s total every time an answer is right.
o At the end of the test:
o displays the result
o asks the user if they want a retest.
You must use pseudocode or program code and add comments to explain how your code works. All
inputs and outputs must contain suitable messages.
Cambridge IGCSE™ and O Level Computer Science Second Edition Study and Revision Guide 10
© Hodder & Stoughton Ltd 2022
14
13 The 1D array StudentName[] contains the names of students in a class. The 2D array
StudentMark[] contains the mark for each subject, for each student. The position of
each student’s data in the two arrays is the same, for example, the student in position 10 in
StudentName[] and StudentMark[] is the same.
The variable ClassSize contains the number of students in the class. The variable SubjectNo
contains the number of subjects studied. All students study the same number of subjects.
The arrays and variables have already been set up and the data stored.
You must use pseudocode or program code and add comments to explain how your code works.
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
...........................................................................................................................................................
15 Write and test a program that uses a two-dimensional array, Game[]to store the moves
in a noughts and crosses game. The program should meet the following requirements:
» Start each game with an empty array.
» Allow two players to input their moves in turn; the contents of the array are displayed
before and after every move.
» One player can input O and the other input X; no other moves are allowed, and no move
can use a space in the array already occupied.
» After every move the program should check for a completed line of three Os or three Xs,
and if found output the winner of the game.
» Use procedures and parameters.
» Include comments to explain how your code works.
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
.................................................................................................................................................................................
Photocopying prohibited
54 Cambridge IGCSE and O Level Computer Science Algorithms, Programming and Logic Workbook