You are on page 1of 8

ADMISSION

NUMBER

DATE

SECOND SEMESTER EXAMINATION - JULY 2022


GRADE 9 (EDEXCEL)
COMPUTER SCIENCE II
Duration : 2 hours

You Must have:


A computer workstation with appropriate programming language code editing software and tools,
including code interpreter/compiler, CODES folder containing code files, pseudocode command set
(enclosed)

Instructions
• Use black ink or ball-point pen.
• Fill in your admission number.
• Answer all questions.
• Answer the questions requiring a written answer in the spaces provided
– there may be more space than you need.
• Only one programming language (Python, C# or Java) must be used throughout the examination.
• Carry out practical tasks on the computer system and save new or amended code using the name
given in the question with the appropriate file extension.
• Do not overwrite the original code and data files provided to you.
• You must not use the internet during the examination.

Information
• The total mark for this paper is 60.
• The marks for each question are shown in brackets
– use this as a guide as to how much time to spend on each question.
• This paper covers Python, C# and Java.
• The CODES folder in your user area includes all the code you need.
• The invigilator will tell you where to store your work.

Advice
• Read each question carefully before you start to answer it.
• Save your work regularly.
• Check your answers if you have time at the end.
• Good luck with your examination.
Grade 9 (Edexcel) Computer Science - II Second Semester Examination July - 2022
Prepared for Lyceum International Schools by Lyceum Assessments
2
Answer all questions.
Answer the questions requiring a written answer in the spaces provided.
Some questions must be answered with a cross in a box . If you change your mind about an
answer, put a line through the box and then mark your new answer with a cross .
Carry out practical tasks on the computer system and save new or amended code using the
name given with the appropriate file extension.
Use only ONE programming language throughout the examination.
Indicate the programming language that you are using with a cross in a box .

C# Java Python

1. Computer Languages use different types of operators.

(a) Identify which one of these is an arithmetic operator.

A Modulus
B Or
C >=
D =

(1 mark)
(b) State what a ‘Constant’ is ?

---------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------
(1 mark)
(c) Open Q01c in the code editor.

The program should find the difference between two numbers and display the
difference.
There are five errors in the code.
Amend the code to correct the errors.
Save your amended code as Q01cFINISHED with the correct file extension for the
programming language.
(5 marks)
Grade 9 (Edexcel) Computer Science - II Second Semester Examination July - 2022
Prepared for Lyceum International Schools by Lyceum Assessments
2

(d) What is ‘Type coercion’?


---------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------
(1 mark)
(e) Ruth has written a program to get two numbers from the user and compare them.
Open Q01e in the code editor.
Amend the code by adding a suitable comment (you may need to add more than one
comment to a line).

(i) At the end of the line where there is a relational operator


(1 mark)
(ii) At the end of the line where selection starts
(1 mark)
(iii) At the end of a line where casting is used
(1 mark)
(iv) At the end of a line where an input is obtained from the user
(1 mark)
(v) At the end of a line where a message is displayed on the screen
(1 mark)

Save your amended code as Q01eFINISHED with the correct file extension for the
programming language.
[Total = 13 marks]

Grade 9 (Edexcel) Computer Science - II Second Semester Examination July - 2022


Prepared for Lyceum International Schools by Lyceum Assessments
3
2. Nitish and Tania are two students from a Computer Science class.

(a) Nitish wants a program to accept the width and height of a rectangle and calculate the area
and the perimeter of the rectangle.
Here is the flowchart for the above problem.

Start

Input width

Input height

area = width * height

perimeter = 2 * (width + height)

Output area

Output perimeter

Stop

Write a program to implement the logic in the flowchart.


Open Q02a in the code editor.
You must use the structure given in Q02a to write the program.
Do not add any further functionality.
Save your code as Q02aFINISHED with the correct file extension for the programming
language.
(8 marks)

Grade 9 (Edexcel) Computer Science - II Second Semester Examination July - 2022


Prepared for Lyceum International Schools by Lyceum Assessments
4
(b) Tania has written a program to convert temperature given in Celsius to Fahrenheit.
Open Q02b in the code editor.
Use the code to answer these questions.
(i) Input the following Celsius values to the program and write the output given by the
program.

Celsius Output
10
0
-10
(3 marks)
(ii) you will not get the expected output if you input Celsius 10.5 to the program.
Write the reason for it.

---------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------------------
(1 mark)

(iii) Open Q02a in the code editor.


Amend the code to get the expected output if you input Celsius 10.5 to the program.
Do not add any further functionality.
Save your code as Q02bFINISHED with the correct file extension for the
programming language.
(1 mark)
[Total = 13 marks]

Grade 9 (Edexcel) Computer Science - II Second Semester Examination July - 2022


Prepared for Lyceum International Schools by Lyceum Assessments
5
3. Ben wants to develop a program for online quiz.

(a) He wants to give the participants a user name at the beginning of the program.

The username should contain the first and last letters (in uppercase) of the participant’s first
name with three digit random integer in the range 100 – 999.

Open Q03a in the code editor.


You must use the structure given in Q03a to write the program.
Do not add any further functionality.
Save your code as Q03aFINISHED with the correct file extension for the programming
language.
(7 marks)

(b) You have to help Ben to design the quiz.

Quiz has three questions.

Question 1: What is the largest planet in the Solar System?


Answer: Jupiter
Question 2: What is the fourth planet from the sun?
Answer: Mars
Question 3: What is the ringed planet?
Answer: Saturn

Display the above questions for the user to answer.

Answers should be validated even if the answers are given in uppercase or lowercase letters.

If the answers are not correct, a suitable message should be displayed.

At the end of the program, correct number of answers should be displayed.

Open Q03b in the code editor.


You must use the structure given in Q03b to write the program.
Do not add any further functionality.
Save your code as Q03bFINISHED with the correct file extension for the programming
language.
(11 marks)

Grade 9 (Edexcel) Computer Science - II Second Semester Examination July - 2022


Prepared for Lyceum International Schools by Lyceum Assessments
6
(c) What is a sub program?

--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------

(1 mark)
(d) Design a suitable Menu for the above program in the space below.

(2 marks)
[Total = 21 marks]

Grade 9 (Edexcel) Computer Science - II Second Semester Examination July - 2022


Prepared for Lyceum International Schools by Lyceum Assessments
7
4. Marlon learns programming as a subject.

(a) He wants to write a program to check whether there is letter ‘a’ in some fruit names.
Fruits.txt contains a list of fruit names.
Open Q04a in the code editor.
Write a program to implement these requirements.
The code must:
 Check each fruit name to ensure it does not contain the letter ‘a’.
 Write fruit names that do not contain the letter ‘a’ to a text file named FruitsA.txt.
You must use the structure given in the file Q04a to complete the program.
Do not add further functionality.
Save your code as Q04aFINISHED with the correct file extension for the programming
language.
(6 marks)
(b) Marlon wants to store some assignment marks in an array.

Help him by declaring an array to store the following marks of his friends scored for
Computer Science Assignment.

45, 85, 92, 22, 55, 83, 62, 35

Then display the maximum marks and minimum marks of the range.

Open Q04b in the code editor.


You must use the structure given in Q04a to write the program.
Do not add any further functionality.
Save your code as Q04bFINISHED with the correct file extension for the programming
language.
(5 marks)
(c) Arrays and records are data structures found in programming languages.
State two features of a record.

--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------------------------
(2 marks)
[Total = 13 marks]
END [Total for the paper = 60 marks]
Ref : AP
Grade 9 (Edexcel) Computer Science - II Second Semester Examination July - 2022
Prepared for Lyceum International Schools by Lyceum Assessments

You might also like