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

2210 - 02 - Status - 02november - 2023

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)
16 views

2210 - 02 - Status - 02november - 2023

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/ 4

2

1. Describe, giving an example for each, the following data types used in programming.
Draw a line to link each pseudocode description to the most appropriate pseudocode statement.
Pseudocode description Pseudocode statement
FOR…TO…NEXT
a loop that will always iterate at least once
IF…THEN…ELSE…ENDIF
a conditional statement to deal with many possible outcomes
WHILE…DO…ENDWHILE
a loop that will always iterate a set number of times
CASE…OF……ENDCASE
a conditional statement with different outcomes for true and false
REPEAT…UNTIL
[4]
2. Pi = 3.14
OUTPUT “Enter Radius Circle “
INPUT r
Area= Pi * r * r
OUPUT “The Area is“ & Area
(a) (i) Name the constant in the above code. ……………...…………...……………..………....[1]
(ii) Name the variable in the above code. ………………...………...……………..………....[1]
(b) State what is meant by a:
Constant ...................................................................................................................................
Variable................................................................................................................................[2]
(c) What is the code for user prompts in above program?
…………………………………………………………………...……………..………....[1]

3. (a) Tick (✓) one box to show the named section of a program that performs a specific task.
A. parameter [ ] B. process [ ] C. file [ ] D. function [ ] [1]
(b) State the output of the build in functions used for
ROUND( 12.9721 , 2 ) ...................................................................................................[1]
(c) Tick (√) whether each of the following is a method of validation.
[1]
Validation
A computer comparing two versions of the data
Applying a length check
Performing a range check
Visually comparing data on screen data source
4. Read the pseudocode statement to count the number which are less than 50.
1 Total = ‘0’
2 FOR Index = 1 TO
3 INPUT Number
4 IF Number > 50 THEN Total = Total + 1
5 NEXT Index
6 OUTPUT Number
(a) Identify which line of code would causes the following errors
run-time .................................................................................................................................

syntax ......................................................................................................................................

logical .................................................................................................................................[3]

© HEGICT 2022 2210 / P2 / Status Test 02 / November 2023


3
(b) These values are used as test data:
50.00 49.99 Fifty
State why each value was chosen as test data.
50.00 .....................................................................................................................................
49.99 .......................................................................................................................................
Fifty ....................................................................................................................................[3]
5. A sports management system is an example of a computer system that is made up of sub-systems.
(a) State an appropriate data type for the following values:
Description Data Type
The average number of goals that a player has score.
The number of goals scores in a football match.
Whether a football player has scored a goal or not.
One letter that are used as a code to identify a group.

[2]
(b) Part of a sports management system:
 A module to enter details for player scores goals for match
 A module to calculate the total or average goals
 A module to display the average goals
Draw a structure diagram for this part of the sports management system. [3]
Sports
Managment

Calculate
Goal

6. The following algorithm inputs 20 numbers and outputs how many numbers were positive (> 0) and
how many numbers were negative (< 0). There are many different errors in this algorithm.
1 negative = 1
2 positive = 1
3 FOR count = 1 to 20 Do
4 INPUT Number
5 IF Number < 0 THEN negative = negative + 1
6 IF Number > 0 THEN positive = positive + 1
7 count = count + 1
8 OUTPUT negative, positive
9 NEXT count
(a) State the line numbers that contain the errors and describe how to correct each error.
Error 1 ....................................................................................................................................
................................................................................................................................................
Error 1 ....................................................................................................................................
................................................................................................................................................
Error 1 ....................................................................................................................................
............................................................................................................................................[3]
(b) State the purpose of this program.
………………………………………………………………......……………..………....[1]

© HEGICT 2022 2210 / P2 / Status Test 02 / November 2023


4

7. (a) State the correct uses for each of the following flowchart symbols. [3]

1 2 3

Symbols use
1
2
3
(b) Complete the following program flowchart by placing the instructions in their correct position.
Diagram that will input 100 positive marks in an array and print out the Total Mark. [4]
Start

I= 0, …….

INPUT ……

Yes
M (I) > …...? T = T + …….

No
I = I+1

……..
I = …..?

Yes. PRINT …….. STOP

(c) Complete the trace table for program assuming the array contains 3 elements 30,-80, 40 have been
input.
Input M M(I)>O T=T+M(I) Output T
30 TRUE 0+30
-80
40

[3]
(d) Describe what the algorithm represented by the flowchart is doing.
………………….……………………………………………......……………..………....[1]

8. FUNCTION Add(Number)
Result = INT(Number * 1.5)
RETURN Result
ENDFUNCTION
X=25
CALL Add(X)
(a) State the keyword, other than the FUNCTION,that suggest the code is a function.
…………………………………………………………………...……………..………....[1]

(b) State the name of the identifiers used for the functions
Argument ...............................................Parameter.............................................................[2]
(c) What is the output of the function? .........................................................................................[1]
(d) What is the build in function used in the above program? ..........................................................[1]

© HEGICT 2022 2210 / P2 / Status Test 02 / November 2023


5
11 The following statements shows three one-dimensional arrays named A and B .
Index A B
[1] 0 2
[2] 5 3
[3] 7 0
(a) State the dimension of any of the array. ....................................................................................[1]
(b) What is the value in array B [3] indicate? ...................................................................................[1]
(c) What will be output of the expression A[2] MOD B[1]............................................................[1]
(d) What will be output of the expression A[3] DIV B[2] ..........................................................[1]
(e) Write an algorithm in pseudocode to output 50 marks that have been stored in the array, Mark [ ] .
………………………..……………...……………………………………….……….……...
………………………..……………...……………………………………….……….……...
………………………………..…………...……………………………………………....[2]
13 Fill in the gaps below to find a name in an array StudentName that could be carried out linear searching

OUTPUT "Please enter name to find "


INPUT -------
Found ← FALSE
Counter ← 1
WHITE Counter < 21 OR Found = ------------ DO
IF StudentName[Counter] = Name THEN
Found ← TRUE
ENDIF
Counter ← Counter + ----
ENDWHILE
IF Found = --------- THEN
OUTPUT Name, " found ",
ELSE
OUTPUT -------------------
ENDIF
[5]

© HEGICT 2022 2210 / P2 / Status Test 02 / November 2023

You might also like