Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Revision practical paper-2024 March-Grade 9

1. Computer programs use several different programming constructs.


(a) Identify the most appropriate data type for the value 4.5

A Boolean
B Character
C Real
D String

(b) Give a definition of a logic error.

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

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

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

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

(c) Give one reason why computer programmers should use comments in their
programs.

..............................................................................
............................................................... ...............
..............................................................................
...................................
2.produce a program in high level language that ask a user to enter a start number and an end
number and output the total of all the numbers in the range. For example, if start number was 1
and the end number was 10, the total would be 55(10+9+8+7+6+5+4+3+2+1)
.

1
3. A company wants a program to generate usernames for new employees. Each username
consists of the first four letters of the employee’s last name and the first letter of their first name
joined together. If the employee’s last name is less than 4 characters a letter ‘X’ is used to fill in
for each of the missing characters. Develop a program that ask the user to input their first and
last names and outputs their username.

4. Develop a program in your selected programming language that creates and initializes an array
to hold these four sets of marks. 45,84,12,74 65,35,87,64 96,92,84,75 56,54,12,32 Print all the
saved values as a separated value list, one after the other. For example, 45 84 12… like that Find
the maximum, minimum and Average marks.

2
5. Create a guessing game program with the following specification.
The computer generates a random number between 1 and 20
The user is asked to enter a number until they enter this random number.
If their guess is too low or too high they are told.
They are told when their guess is correct
They are asked if they want to play another game until their answer is ‘NO’

6. Produce a python program that will print out the times table(up to 12 times)for the numbers 2
to 12

7. list the techniques you should use to make your programs easy to read and understand

3
8. Develop a python program for a simple calculator that allows
a. The user to choose from these options: addition, subtraction, division and multiplication
b. Prompts the user to enter two numbers
c. Prompts the calculation and displays the result
d. Offer the user the option of performing another calculation

9. Declare an array with the 5 elements of foods. In a high-level language, create a program to
find the length of the array and traverse it, printing out each of the items.

4
10.A record data structure is to be used to store the details of music albums. Provide the
appropriate data type for these fields.
a. the title of the album
b. the name of the artist
c. the year of release
d. the genre
Develop a program that uses a record structure for storing the details of music albums. It must:
a. have fields for title, artist, year of release and genre
b. allow the user to input the details of new albums
c. allow the user to search for an album by name and display its details.

You might also like