XMSS 2018 P1 Solution
XMSS 2018 P1 Solution
Total [5]
Total [2]
3 Inputs: [6]
- 24 student names
- 24 marks for Physics
Outputs:
- Name of the student with the lowest score
- score for that student
Processes required:
- Store input data in arrays/lists
- Search for the student with the lowest mark/sort the arrays in mark
order
Total [6]
Total [3]
1
5 [5]
num sum n rem OUTPUT
371
0 371
1
1
37
7
344
3
3
371
0
TRUE
Total [5]
a variable: A name with an associated value that can be changed while [1]
the program is running.
an array: Sequence where all the items have the same size and are [1]
arranged consecutively in memory.
Total [3]
Total [9]
8 length check: Process of ensuring that input data is not too long or too [1]
short.
range check: Process of ensuring that input data is within the required [1]
range of values.
Total [2]
2
9 Error 1: Total = 500 [1]
Total [8]
10 [5]
Total [5]
3
11 2 401 = 200R1
b
2 200 = 100R0
2 100 = 50R0
2 50 = 25R0
2 25 = 12R1
2 12 = 6R0
2 6 = 3R0
2 3 = 1R1
2 1 = 0R1
11 16 11001 = 687R9
c
16 687 = 42RF
16 42 = 2RA
16 2 = 0R2
Total [6]
12 [6]
Total [6]
4
13 =B5/C5 [1]
a
13 [4]
c
Total [6]
Total [6]
5
15 Flowchart [8]
START
number = []
negative = 0
positive = 0
index = 0
No
Is index <
20?
Yes
INPUT number[index]
Is number[index] <
50?
Yes
No
OUTPUT index
Is number[index] <
0?
Yes
No
index = index + 1
OUTPUT negative
END
6
15 Pseudo-code [8]
number = []
negative = 0
positive = 0
index = 0
WHILE index < 20
INPUT number[index]
IF number[index] < 50
OUTPUT index
ENDIF
IF number[index] < 0
negative = negative + 1
ELSE
positive = positive + 1
ENDIF
index = index + 1
ENDWHILE
OUTPUT “Number of negative numbers: “ + negative
OUTPUT “Number of positive numbers: “ + positive
Total [8]