0% found this document useful (0 votes)
296 views

Computer Science 0478 - Paper - 2

This document is an exam for a Computer Science class assessing problem-solving and programming skills. It contains instructions for students to answer questions related to sample programming tasks. The exam consists of 10 printed pages and students have 1 hour and 30 minutes to complete it. The first section asks students to define variables and constants they may have used in a sample task, as well as writing pseudocode to validate user input and store names in an array. It also asks students to identify different types of test data needed to validate the user input.

Uploaded by

Trynos
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)
296 views

Computer Science 0478 - Paper - 2

This document is an exam for a Computer Science class assessing problem-solving and programming skills. It contains instructions for students to answer questions related to sample programming tasks. The exam consists of 10 printed pages and students have 1 hour and 30 minutes to complete it. The first section asks students to define variables and constants they may have used in a sample task, as well as writing pseudocode to validate user input and store names in an array. It also asks students to identify different types of test data needed to validate the user input.

Uploaded by

Trynos
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/ 10

RIVERTON ACADEMY INTERNAL EXAMINATION

NAME……………………………………………………………………….CLASS……………….

COMPUTER SCIENCE
FORM 4 Mid-Year Examination 2022
SYLLABUS CODE 0478/22 Paper 2 Problem-solving and Programming
TIME 1 hour 30 Minutes
DATE 26 JULY 2022 AM
Candidates answer on the question paper

INSTRUCTIONS TO CANDIDATES
1. Write your name and class in the space at the top of this page.
2. Answer all the questions in the spaces provided.
3. The use of an electronic calculator is not allowed.
4. You are reminded of the need for clear presentation in your answers.
5. The number of marks is given in brackets [] at the end of each question or part question.

TOTAL NUMBER OF MARKS FOR THIS PAPER IS 75


This Question Paper consists of 10 printed pages.

1|P a g e
You are advised to spend no longer than 40 minutes answering this section.
Here is a copy of the pre-release material.
DO NOT attempt Tasks 1, 2 and 3 now.
Use the pre-release material and your experience from attempting the following tasks
before the examination to Question 1.
Pre release material

2|P a g e
1 (a) All variables and other identifiers should have meaningful names.
(i) When you completed your Task1.You might have declared some variables. State two
variables that you might have declared and state their data types.

Variable 1:
………………………………………………………………………………………………………………………………………………
…………………………………………………………………….........................................................................[1]
Data type:
………………………………………………………………………………………………………………………………………………
…………………………………………………………………….........................................................................[1]
Variable 2:
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………….[1]
Data type:
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………….[1]

(ii) When you completed your Task1.You might have declared some constants. State two
constants that you might have declared and state their data types
Constant 1:
………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………..[1]
Constant 1:
………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………..[1]

(iii) Declare the array used to store 20 names of visitors who intend to book parking spaces
for day 1.

....................................................................................................................................... ….. [1]


(iv) Change this declaration so the array can only hold records for a sample of 100 visitors.
.............................................................................................................................................. [1]

3|P a g e
(b)Write an algorithm, using pseudocode to validate the day number input by the
user(visitor). Hint: Include appropriate prompts for the entry of data

………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
…………………………………………………………………………………………………………………………………………. [5]
(c) Write an algorithm to input and store the names of 20 visitors into an array you declared
above.
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………….[4]
(d) Identify three types of test data and an example data value you would use to test the
day number entered in 1(b)
Test data 1:…………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………….[1]
Test data 2:…………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………….[1]
Test data 3:…………………………………………………………………………………………………………………………..
………………………………………………………………………………………………………………………………………………
………………………………………………………………………………………………………………………………………….[1]

4|P a g e
5|P a g e
6|P a g e
7|P a g e
8|P a g e
9|P a g e
10 | P a g e

You might also like