SRSS 2020 P1 Solution
SRSS 2020 P1 Solution
Sec 4E
2020 Preliminary Exams (Marking scheme)
Q1a) [4 m]
A
X
B
A B X
0 0 1
0 1 1
A
X
B
A B X
0 0 0
1 1 1
A
X
B
A B X
0 1 0
A 1 1 0
X
B
1
Q1b) [5m]
B X
Q1c) [4 m]
D E F G X
A B C
(NOT B) (D NAND C) (A OR E) (A NOR B) (F AND G)
0 0 0 1 1 1 1 1
0 0 1 1 0 0 1 0
0 1 0 0 1 1 0 0
0 1 1 0 1 1 0 0
1 0 0 1 1 1 0 0
1 0 1 1 0 1 0 0
1 1 0 0 1 1 0 0
1 1 1 0 1 1 0 0
2
Q2) [5 m]
(a) The network interface card is the hardware interface that enables the
transfer of data between a device and a network.
(d) The router is a device that forwards packets between separate networks.
(e) The network hub is a device that transmits received packets to all
connected devices.
Q3a) [4 m]
Q3b) [2 m]
3
Q4a) [2 m]
(1 0 0 1 0 1 1 0)2
= 21 + 22 + 24 + 27
= 2 + 4 + 16 + 128
= 150
Q4b) [2 m]
459 = 1CB16
Q4c) [3 m]
Q5c) [2 m]
4
• Cells C3 and C4 must be absolutely referenced for the formula in
cell D7 (if answer in 5b shows absolute referencing, assume
student has stated this point)
• Select cell D7, (right-click) copy the cell and (right click) paste on
cells D8 to D11
• Select cell D7, move mouse to the bottom right corner of the cell
until a plus-shaped (+) cursor can be seen; click and drag the
cursor all the way to cell D11
Q5d) [2 m] =IF(D7>E7,”Profit”,”Loss”)
5
5 7
1 4
6 3 8
Q7a) [2 m]
Q7b) [4 m]
6
• Databae sentry modules (accept any meaningful names, limit to 1
only)
• Gantry operation module
• LCD display module
Q7ci) [2 m]
valid_contact boolean
contact_num string
Q7cii) [2 m]
Q7ciii)[2 m]
Q7civ) [2 m]
Line number: 09
Changed line:
IF contact_num[0]!="9" or contact_num[0]!="8"
or contact_num[0]!="7" or contact_num[0]!="6"
OR
Q8a) [5 m]
7
Accept Reject Count Sack OUTPUT
0 0 0 49.2 7, 3
1 1 1 50.4
2 2 2 49.5
3 3 3 50.2
4 4 50.0
5 5 49.7
6 6 50.1
7 7 51.3
8 50.5
9 50.6
10
Q8b) [1 m]
Q8c) [2 m]
8
Q9) [8 m]
• Error 1: line 04
Correction: WHILE Number < 0 OR Number > 100
• Error 2: line 08
Correction: NumArray[Index] = Number
• Error 3: line 09
Correction: IF Number >= 50 THEN Count = Count + 1
• Error 4: line 10
Correction: Until Count = 40 NEXT Index
Q10) [7 m]
Sample algorithm:
CityACount = 0
CityBCount = 0
CityAHighest = -999
CityBLowest = 999
9
FOR Days = 1 to 365
Input CityA, CityB
IF CityA > CityB
CityACount = CityACount + 1
ELSE IF CityB > CityA
CityBCount = CityBCount + 1
ENDIF
10