0% found this document useful (0 votes)
39 views13 pages

CS Year 10 Practical June 2023

The document describes a computer science practical exam containing multiple programming questions. It provides instructions, context and partial code for students to complete programming tasks related to concepts like variables, data types, sorting algorithms, encryption, and determining if a year is a leap year. Students are asked to write and run code, find and fix errors, and demonstrate their understanding of programming fundamentals.

Uploaded by

bondej642
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
0% found this document useful (0 votes)
39 views13 pages

CS Year 10 Practical June 2023

The document describes a computer science practical exam containing multiple programming questions. It provides instructions, context and partial code for students to complete programming tasks related to concepts like variables, data types, sorting algorithms, encryption, and determining if a year is a leap year. Students are asked to write and run code, find and fix errors, and demonstrate their understanding of programming fundamentals.

Uploaded by

bondej642
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/ 13

COLOMBO INTERNATIONAL SCHOOL KANDY

SENIOR SECTION

Year 10

Computer Science-Practical

End of 3rd Term Examination-June 2023

3 hours
Task Total Mark
Name: Task 1
Task 2
Class :
Task 3
Task 4
Task 5
Total
Instructions:
1. The total mark for this paper is 80.
2. The marks for each question are shown in brackets – use this as a guide as to how much
time to spend on each question.
3. Attempt all questions.
4. Write your answers in the question paper itself.
5. Save your work regularly.
6. Workings should be shown for conversions and calculations.
1. Programmers write code to solve problems.
(1)
(a) Identify the description of a variable in a computer program.

A A value that cannot be used more than once

B A value that must be input

C A value that is always used in a calculation

D A value that can change

(b) Identify the technique that improves the readability of code.


(1)
A Using indents on every line
B Using descriptive names for variables
C Using the correct operators
D Using suitable data structures

( c) Complete the table by giving an example value for each data type
The first row has been completed for you.
(2)
Data Type Example Value
Integer 14
Char
Real

(d) Describe one difference between the data used in boundary testing and the data
used in erroneous testing.
(2)

………………………………………………………………………………………………………

………………………………………………………………………………………………………

………………………………………………………………………………………………………

………………………………………………………………………………………………………

………………………………………………………………………………………………………

(e) A program should output the value 2


However, there is an error in the code and the actual output is 4
Name this type of error.

(1)

………………………………………………………………………………………………………

(f) Open Q01f in the code editor.


The program should allow the input of the length of the side of a square and
output the area of the square.
There are three errors in the code.
Amend the code to correct the errors.
Save your amended code as Q01fFINISHED with the correct file extension for the
programming language.

(3)

(g) A program is needed that will accept the input of a letter and compare it with a
stored letter.
It will check whether the letter comes earlier in the alphabet, later in the alphabet
or is the same letter as the stored letter.
It will output the letter and the stored letter with an appropriate message.
Open Q01g in the code editor.
Amend the code to complete the if statement used to produce the output.
You must use the structure given in Q01g to complete the program.
Do not add any further functionality.
Save your code as Q01gFINISHED with the correct file extension for the
programming language.

(4)

(Total for Question 1 = 14 Marks)


2. A student is learning about sorting and searching algorithms.

(a) The student has been given a partially completed program to carry out a binary search.

The pseudocode contains the logic required to complete the program.

Open file Q02a in the code editor.


Amend the code to complete the program.
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.

(10)

(b) Figure 1 shows an array of names


0 1 2 3 4 5 6 7
Yonali Julian Fred Sneha Charlie Bimmy Adrian Mona
Figure 1
Explain why a binary search algorithm would not find 'Julian' in the array.
(4)
………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

(c ) Describe the steps a linear search algorithm takes to find a search item.
(5)

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………

………………………………………………………………………………………………
3. A student sells copies of a science textbook to schools.
a program is needed to process textbook orders. It must:
• accept the input of the number of textbooks required
• generate the price per textbook
• generate the total cost of the order
• display the price per textbook and the total cost of the order.

The price of one textbook depends on the number ordered:


Quantity Price per Book
1-5 £ 20.00
6-9 £ 15.00
10 or More £ 12.00

Open Q03 in the code editor.


Write the program.
You must use the structure given in Q03 to complete the program.
Do not add any further functionality.
Save your code as Q03FINISHED with the correct file extension for the programming
language

(Total for Question 3 = 10 Marks)


4. Several encryption algorithms have been developed.
(a) Identify what is meant by encryption.
(1)
A Conversion of ciphertext into plaintext
B Conversion of plaintext into ciphertext
C Conversion of code into data
D Conversion of data into information

(b) Figure 2 shows a Pigpen cipher grid.

Figure 2

Complete the table by adding the symbol for each letter in the word JANUARY
(7)
Letter J A N U A R Y
Symbol

Figure 2

(c ) Figure 3 shows another grid.


Figure 3

State whether this set of symbols meets the requirements of a Pigpen cipher.
Justify your answer.

(4)
State

………………………………………………………………………………………………………

Justification

………………………………………………………………………………………………………

……………………………
…………………………………………………………………………

(d ) The message THE ENEMY IS NEAR is encoded using a different encryption


algorithm.
Figure 4 shows the first stage of the encryption process.

Figure 4
(i) Give the key used in the first stage of the encryption process.
(1)
………………………………………………………………………………………………………
(ii) Give the ciphertext that is produced by the encryption algorithm.
(1)
………………………………………………………………………………………………………
(iii) Give the name of the encryption algorithm that has been used to produce
the ciphertext.
(1)
……………………………………………………………………………………………………

(iv) Explain one reason why the given encryption algorithm is a weak
encryption algorithm.
(2)
………………………………………………………………………………………………………

………………………………………………………………………………………………………

(Total for Question 4 = 17 Marks)


5. (a) A leap year is a year that has 366 days rather than 365 days. A leap year usually
occurs every four years.
A year that is a leap year:
• can be exactly divided by 400
Or
• can be exactly divided by 4, but not exactly divided by 100.
These years are leap years: 2000, 2012 and 2020.
These years are not leap years: 1700, 1900 and 2021.
A program is needed that will accept the input of a year and output whether it is
a leap year or not.

(10 Marks)
Open Q05a in the code editor.
Write the program.
You must use the structure given in Q05a.
Do not add any further functionality.
Save your code as Q05aFINISHED with the correct file extension for the
programming language.
(b) A student wants a program that will calculate the number of fence panels
that require to surround building sites such as the one shown in the diagram (not to
scale)

Each building site is a rectangle.


Each fence panel is 1 metre long.
A gap of 4 metres is needed to access each site. The location of the gap is not
significant.
The user will input the length and width of the building site as whole numbers of
metres.
The program will output the minimum number of full panels needed.
Q05b provides a structure for the program.
(10 Marks)

Open Q05b in the code editor.


Write the program.
You must use the structure given in Q05b to write the program.
Do not add any further functionality.
Save your code as Q05bFINISHED with the correct file extension for the
programming language.

(Total for Question 5 = 20 Marks)

You might also like