Sie sind auf Seite 1von 4

1.

The terms given in the table below represent various types of


statements used in programming. Write the numerals I, II, III, IV and V on
separate lines in your answer sheet. Match EACH term with the CORRECT
program statement and write that term next to the corresponding numeral in
your answer sheet.
Numera Program Statement Term
l
I J5 input statement
II if (mark >= 50) write arithmetic
(PASS); expression
III ans := A div B; conditional
statement
IV A := B; variable name
V read(a, b, c); assignment
statement
Total 5 marks

2.
a) Define the term flowchart. (1 mark)

b) The following symbols are used when drawing a program


flowchart. Give the name of EACH of the program flowcharting
symbols shown below.

(i) START STOP

(ii)

(iii)

(iv)
Yes

No
(v)

1 1
(5 marks)

c) Draw a flowchart to obtain and store the cost of examination fees


for music.
(4 marks)
Total 10 marks
3. TABLE 3

Label Statements
s
S1 Select the most efficient solution.
S2 Test and validate the solution.
S3 Definition of the problem.
S4 Develop the algorithm.
S5 Propose and evaluate solutions.

a. Table 3 show labels in Column 1 and statements that represent the steps in
problem solving in Column 2.

Arrange the labels to show the correct order in which the steps in problem solving
occur. Write that order in your answer sheet.
(5 marks)

b. You are using a program to calculate the average number of storms that have
recently passed through the Caribbean. This is calculated by adding the number
of storms and then dividing by the number of years. The screen for the program
looks like the one below:

STORM

Enter the Number of Years


(1 to 4)

Enter the Number of

Year Year Year Year


1 2 3 4

Average Number of
You were told that the number of storms for the last three years were 10, 8, and
12.

(i) State the data that will be input into:

1. The number of years

2. Year 1

3. Year 2

4. Year 3

5. Year 4 (5 marks)

(ii) State the result for the Average number of storms. (1 mark)

(iii) Write an algorithm using pseudocode to input the number of storms for
EACH of three years, calculate the average number of storms, and output
the result. (4 marks)
Total 15 marks

4. Each of the following programming statements contains ONE error. Rewrite EACH
statement, correcting the error.

i. IF X = 3 TRY Y := 8;

ii. READ Please enter a number

iii. WRITE the number is num . (3 marks)

b.

i. Explain the difference between a variable and a constant. (2 marks)


c. Write an example of a value that can be stored in EACH of the following types of
variables:

i. Integer

ii. Real

iii. Character

iv. String (4 marks)


Total 10 marks

Das könnte Ihnen auch gefallen