80% found this document useful (5 votes)
3K views

Computer Science 15 Mark Question Bank

Uploaded by

Surya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
80% found this document useful (5 votes)
3K views

Computer Science 15 Mark Question Bank

Uploaded by

Surya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Cambridge IGCSE™ and O Level Computer Science

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.

Students are awarded a grade based on their average mark.

Average mark Grade awarded


greater than or equal to 70 distinction
greater than or equal to 55 and less than 70 merit
greater than or equal to 40 and less than 55 pass
less than 40 fail

Write a program that meets the following requirements:


• calculates the combined total mark for each student for all their subjects
• calculates the average mark for each student for all their subjects, rounded to the nearest
whole number
• outputs for each student:
– name
– combined total mark
– average mark
– grade awarded
• calculates, stores and outputs the number of distinctions, merits, passes and fails for the
whole class.

You must use pseudocode or program code and add comments to explain how your code works.

You do not need to initialise the data in the array.

...........................................................................................................................................................

...........................................................................................................................................................

...........................................................................................................................................................

...........................................................................................................................................................

...........................................................................................................................................................

...........................................................................................................................................................

...........................................................................................................................................................

...........................................................................................................................................................

...........................................................................................................................................................

...........................................................................................................................................................

© UCLES 2020 0478/02/SP/23


8 Programming

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

318472_08_IGCSE_OLCSPW_026-054.indd 54 24/04/21 1:29 PM

You might also like