MIDTERM Test - CS - 9IGCSE
MIDTERM Test - CS - 9IGCSE
Time: 60 minutes
Date: Class:
Name: Score:
Section A: [Multiple Choice]
a. 4, 1, 2 c. 4, 2, 1
b. 1, 2, 3, 4 d. 3, 1, 2
a. None c. 4
b. 5 d. 1
Q.9: What are the parameters within this procedure?
a. Error c. Hello
b. Hello, World d. World
Q.1: Define the following key terms and give examples if necessary: [5]
a. Record
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
b. Constructor
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
c. Procedure
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
d. Function
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
e. Parameter
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
Q.2: Figure below shows an algorithm, written using pseudocode, that uses a RECORD data structure for
storing information about a film.
• Film title
• Certificate (e.g 12A, PG)
• Year the film was made
• If the film is currently being shown at a cinema
There are records for three films and these films are stored alphabetically in an array called filmCollection.
The Pseudocode outputs the title of the newest of the three films.
a. Write a pseudocode statement that updates the antMan record to show that the film is
currently being shown at the cinema. [2]
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
b. Write the constructor in Python that initializes the fields of the above record [3]
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
______________________________________________________________________________
Q.3: The size of a sound file is calculated using the following formula:
The algorithm below, should output the size of a sound file in BYTES that has been sampled 100
times per second, with a sample resolution of 16 bits and a recording length of 60 seconds.
a. Complete the algorithm, by filling in the gaps using the items below. You will not need
to use all the items. [6]
b. A local variable called size has been used in getSize. Explain what is meant by a local
variable. [1]
_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
_________________________________________________________________________
Q.1: Sentia School keeps records of all teachers in a database file. Each record stores three fields, the
teacher’s name, number of years working at Sentia School, and salary.
a. Write a python program that allows the HR to create multiple records of teacher’s
information. [10]
b. Write a subroutine Highest_Salary that returns the teacher(s) earning the highest salary. [2]
c. If a teacher has worked at Sentia School for more than 10 years and is earning less than
$1000, HR will increase their salary by 5%. Write a subroutine called Raise that implements the
above information. [5]
d. Write a subroutine Average_Salary that returns the average salary of teachers at Sentia
School. [3]