0% found this document useful (0 votes)
16 views16 pages

BLSS 2019 P1 Solution

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 views16 pages

BLSS 2019 P1 Solution

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

BOON LAY SECONDARY SCHOOL

PRELIMNARY EXAMINATION
2019

Name ANSWERS [ ]
CCA

Subject : COMPUTING
Paper No : 1
Subject Code : 7155/01
Level : SECONDARY FOUR EXPRESS
Date/Day : XX XXX 2019 / XXXDAY
Time : XXXX - XXXX
Duration : 2 HOURS

Candidates answer on the Question Paper.


No Additional Materials are required.

READ THESE INSTRUCTIONS FIRST

Before you start your exam, check that you have received the correct paper and the number
of printed pages are correct.

Write your name, index number, and CCA in the spaces at the top of this page.
Write in dark blue or black pen.
You may use an HB pencil for any diagrams or graphs or rough working.
Do not use staples, paper clips, glue or correction fluid.

Approved calculators are allowed.

Answer all questions.

The number of marks is given in brackets [ ] at the end of each question or part question.
You should show all your working.
The total number of marks for this paper is 80.
2

This document consists of 15 printed pages.

1 (a) Denary numbers are stored as binary numbers inside a computer.

(i) Convert the denary number 168 into 8-bit binary. Show your working.

………………………………………………………………………………………………….[1
]

1010 1000

(ii) Convert the positive whole binary number 11010011 into a denary number. Show your
working.

………………………………………………………………………………………………….[1
]

211

(iii) Convert the hexadecimal number AC into its binary representation. Show your working.

………………………………………………………………………………………………….[1
]

1010 1100

(b) Hexadecimal numbers are commonly used in file compression techniques and in Media
Access Control (MAC) addresses.

(i) Calculate the largest numerical value that can be stored by the following numbers. Show
your working.

A 4-character binary number

(1111) : 15

………………………………………………………………………………………………….[1
]

A 4-character hexadecimal number

(FFFF) : 65535

………………………………………………………………………………………………….[1
]

BLS/EYE/2019/4E/COMP/7155/01
3

(ii) State and describe one other use of the hexadecimal number system.

……………………………………………………………………………………………………
.

………………………………………………………………………………………………….[2
]

RGB colour scheme codes / Memory addresses

2 A computer network is a system of two or more computers that are connected together by a
transmission medium for the exchange of data.

(a) The diagram below shows how a home network is connected to the Metropolitan Area
Network (MAN).

(i) Complete the diagram by filling in the appropriate networking devices for the three
parts labelled i., ii., and iii.

Networking devices:

Router, Modem, Bridge, Network Interface Card

MAN Home network

i.
iii.

Server ii. Home terminal

iii.

Mobile devices

i. …………………………………………………………………………………………………

ii. …………………………………………………………………………………………………

iii.
………………………………………………………………………………………………[2]

BLS/EYE/2019/4E/COMP/7155/01
4

(ii) Explain the functions of the following networking devices:

Router

……………………………………………………………………………………………………
.

…………………………………………………………………………………………………[2]

Connects different networks, typically between internet and intranet. Determines which
terminal to send information to through ip addresses. Information only meant for
intended recipients.

Network Interface Card (NIC)

……………………………………………………………………………………………………
.

…………………………………………………………………………………………………[2]

Allows information exchange between a terminal and a network. Is uniquely identified


by a MAC address.

(b) (i) Compare the difference in purpose and functionality(how it works) between a client-
server network and a peer-to-peer network. You may use an example to aid your
answer.

……………………………………………………………………………………………………
.

……………………………………………………………………………………………………
.

………………………………………………………………………………………………….[3
]

Purpose: client-server hosts information centrally, larger number of nodes,


p2p information is hosted on many individual nodes, generally smaller sharing number
of nodes. [1]

Functionality: client-server no need to have multiple copies of the same information.


Highly scalable. Easy to add clients. possible to be local / non-local (VPN)

P2p information is shared directly, no need for hosting. Usually local.

(ii) With reference to the transfer of information to terminals on a network, explain one
difference between a bus and a star network.
BLS/EYE/2019/4E/COMP/7155/01
5

……………………………………………………………………………………………………
.

………………………………………………………………………………………………….[2
]

information on a bus network is sent on the bus and is received by all terminals
connected to the network. In a star network, information is only sent to the intended
recipient(s).

(iii) Explain what are parity bits and benefits of using parity bits in data communication.
Include the working principle of either odd or even parity bits.

……………………………………………………………………………………………………
.

………………………………………………………………………………………………….[4
]

Data that has been transmitted can be checked to determine if an error has been
incurred during the course of transmission.

Parity bit: a bit in the data packet is used to signify if there were supposed to be an odd
or even number of 1s in the packet. This would have been pre-agreed upon.

Even parity: it is set to 0 if the number of 1-bits in the packet is supposed to be an even
number. If there is an odd number of 1-bits, the parity bit will be set to ‘1’ so that there
will be an even number of 1-bits in the packet. The logic is similar for odd-parity.

3 Consider the following algorithm.

1 x = 0
2 y = 0
3 while True:
4 num = input("Key in an integer: ")
5 out = 0
6 for i in range (len(num)):
7 out += int(num[i])*i
8 if out % 5 == 0:
9 x += 1
10 else:
11 y += 1
12 print("X: {}, Y: {}".format(x,y))
13 if (input("Try another number? (Y/N)").upper() != 'Y'):
14 break

(a) (i) Complete the trace table for the algorithm.

Use the data 1522, Y, 66733, Y, 23452, y, 35323, y, 1234, n, 8572, Y

BLS/EYE/2019/4E/COMP/7155/01
6

x y out

0 0 0

15

1 0 41

1 34

2 29

[5]

(ii) State the purpose of the algorithm. Assume only valid inputs are keyed in.

……………………………………………………………………………………………………
.

………………………………………………………………………………………………….[2
]

To find out the sum of digits in an input and to count the number of sums that are divisible
by 5.

(b) (i) Explain a benefit of including input validation checks in a computer program.

……………………………………………………………………………………………………
.

……………………………………………………………………………………………………
.

…………………………………………………………………………………………………[1]

To ensure that the input is valid so that the program can function as intended.

(ii) Write a validation check for the user input in the program above using pseudo code.

……………………………………………………………………………………………………
.

……………………………………………………………………………………………………
.

……………………………………………………………………………………………………
.

…………………………………………………………………………………………………[3]

check = True #declare tracking variable

BLS/EYE/2019/4E/COMP/7155/01
7

for digit in num: #valid method to check input

if digit.isdigit() == False:

check = False

print(“Invalid input”) #valid output to inform user of invalid


input.

Accept methods for valid validation checks: presence, format,


type.

4 State the function and describe one difference for each of the following

(a) (i) Data and address buses

Function: …..…………………………………………………………………………………….

……………………………………………………………………………………………………
.

Difference:
……………………………………………………………………………………….

………………………………………………………………………………………………….[3
]

Buses are used to transfer information between different parts of a computer. [1]

Data buses are bi-directional and they allow for information transfer between the
processor and memory/storage.[1]

Address buses are uni-directional and only allow information transfer from the processor
to memory. [1]

(ii) Memory and external storage

Function: …..…………………………………………………………………………………….

……………………………………………………………………………………………………
.

Difference:
……………………………………………………………………………………….

………………………………………………………………………………………………….[3
]

Memory and storage are used to store data that is used by the processor. [1]

Memory are generally smaller in capacity compared to storage, are much faster, more
expensive, and are located closer to the processor. [1]

BLS/EYE/2019/4E/COMP/7155/01
8

External storage are larger in capacity, relatively slower, cheaper and are usually further
away from the processor. [1]

[accept any valid pair]

(b) Complete the truth tables for the gates shown below:

NAND gate NOR gate

Input 1 Input 2 Output Input 1 Input 2 Output

0 0 1 0 0 1

0 1 1 0 1 0

1 0 1 1 0 0

1 1 0 1 1 0

[2]

5 (a) Draw the logic circuit to represent the following Boolean statement. Do not simplify the
statement.

X = (A OR B) AND (NOT (A) OR C)

BLS/EYE/2019/4E/COMP/7155/01
9

A
-

B X
- -

C
-

[4]

(b) Complete the truth table for the Boolean statement:

X = (A OR B) AND (NOT (A) OR C)

A B C Working Space X

0 0 0

0 0 1

0 1 0

0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

[3]

6 A receptionist at a hotel wrote a program to find out how many of his guests have first or last names
that have at least 5 characters. The program also outputs the first and last names that have at least
5 characters. There are some errors in his program will give him the correct statistics.

BLS/EYE/2019/4E/COMP/7155/01
10

You may assume that all the names in the list namelst are valid and are made up of only two
words. The first word in each name is the first name and the second word is the last name.

1 namelst=['Eryn Hobby', 'Sharie Walko', 'Corrine Rieck', 'Latina


Carns', 'Jeanetta Mertens', 'Jenae Yoshimoto', 'Geoffrey Gause',
'Elaina Pack', 'Jenelle Brickhouse', 'Nathanial Jacoby', 'Ulrike
Selleck', 'Maryellen Hurlbut', 'Mose Jenner', 'Randall Wozniak',
'China Erick', 'Annamaria Seeley', 'Reva Ryman', 'Tera Ling', 'Phil
Kellison', 'Judith Larue', 'Elfreda Kallenbach', 'Cristina Hu',
'Serafina Theis', 'Tiesha Gero', 'Maryrose Mcdermott', 'Sheena
Dawes', 'Shea Cagle', 'Luella Fortunato', 'Robyn Conlon', 'Reena
Knisley', 'Deonna Orbison', 'Louisa Barrington', 'Adrian Mcgrory',
'Fredericka Halas', 'Felipa Strausbaugh', 'Aisha Greaney', 'Ann
Weyandt', 'Dorothea Sand', 'Terry Bedford', 'Horace Lamoureaux',
'Myrna Abundis', 'Garrett Enger', 'Emma Mertz', 'Rachele Almaguer',
'Gale Delsignore', 'Neomi Traylor', 'Rosemarie Wyatt', 'Latrisha
Steinke', 'Jerri Larkey', 'Bridget Leal']
2
3 long_firstn, long_lastn = 0,0
4 long_first_name = []
5 long_last_name = []
6
7 for name in namelst:
8 first_name=name.split(' ')[1] #0 instead of 1 (logic)
9 last_name=name.split(' ')[1]
10
11 if len(first_name) > 5:#>= instead of > (logic)
12 long_first_name += [first_name]
13 long_first_name += 1 #long_first_n (syntax)
14 else len(last_name) >= 5: #elif (syntax)
15 long_last_name += [last_name]
16 long_lastn += 1
17
18 print("Long first names: {}\n{}\n\nLong last names:
{}\n{}".format(long_firstn,long_first_name,long_lastn,long_last_na
me))

The correct output of the program is shown below.

(a) There are four errors in the given algorithm.

State each error and write the correct pseudo-code.

BLS/EYE/2019/4E/COMP/7155/01
11

Error 1 …………………………………………………………………………………………………..

Correction 1...…………………………………………………………………………………………..

Error 2 …………………………………………………………………………………………………..

Correction 2...…………………………………………………………………………………………..

Error 3 …………………………………………………………………………………………………..

Correction 3...…………………………………………………………………………………………..

Error 4 …………………………………………………………………………………………………..

Correction 4...…………………………………………………………………………………………..

[8]

(b) Suggest why a list datatype is used to store the names instead of a string.

………………………………………………………………………………………………………...[1
]

Lists allows the storage of items of different datatypes and can be called out individually using
its index. Strings do not have this flexibility.

7 There has been a number of reports of researchers who plagiarise work.

(a) Explain plagiarism and its impact on society.

.…………..………………………………………………………………………………………….......

.…………..…………………………………………………………………………………………...[2]

Unauthorised copying of work from other people and passing it off as their own.

Accept any valid point on how plagiarism negatively impacts the original author and society.

(b) (i) Explain the difference between phishing and pharming.

.……………………………………………………………………………………………….......

.………………………………………………………………………………………………...[2]

Phishing baits the user to enter their information into a fake portal whereas pharming
involves the interception of data while it is on route to its original destination.

(ii) Describe how a researcher can prevent him/herself from falling prey to spyware.

.……………………………………………………………………………………………….......
BLS/EYE/2019/4E/COMP/7155/01
12

.………………………………………………………………………………………………...[2]

Use SSL websites; check for lock; https;

(c) Explain Two Factor Authentications (2FA) in the context of account security.

Two Factor Authentication (2FA)

………………………………………………………………………………………………………......
.

………………………………………………………………………………………………………......
.

………………………………………………………………………………………………………...[2
]

Use: Accounts are protected via two sets of passwords. The second is usually generated as
a OTP or using a pre-assigned unique key generator.

(d) Explain a benefit and limitation of One Time Passwords (OTP) in 2FAs.

Benefit: .…………………………………………………………………………………………….......

………………………………………………………………………………………………………......
.

Limitation: ………………………………………………………………………………………….......

………………………………………………………………………………………………………...[2
]

Benefit: Generates a unique one-time password each time the user tries to login to his/her
account. Difficult for a hacker to obtain the OTP as it is randomly generated.
Limitation: The password needs to be sent to the user each time. User must be reachable
via a network (typically mobile phone network).

BLS/EYE/2019/4E/COMP/7155/01
13

8 John wishes to buy a car that is currently worth SGD 120,000. He is able to pay SGD 50,000 upfront
and takes a loan from the bank on the remaining amount.

He has to repay the loan over a period of 5 years and the bank charges an interest of 2.68% per
annum. At the end of 5 years, he would have paid the bank SGD 79,896.42.
The table lists several financial functions that are available in a spreadsheet.

Name Function arguments

Payment =pmt(rate,nper,pv,[fv],[type])

Present value =pv(rate,nper,pmt,[fv],[type])

Future value =fv(rate,nper,pmt,[pv],[type])

Rate =rate(nper,pmt,pv,[fv],[type],[guess])

Interest payment =ipmt(rate,per,nper,pv,[fv],[type])

Principal payment =ppmt(rate,per,nper,pv,[fv],[type])

(a) Write down the formula that will allow John to verify the amount that he has to repay the bank
at the end of the loan period. Include the necessary arguments.

……………..………………………………………………………………………………………….[1
]
=fv(2.68%,5,0,70000)

(b) Loan repayments are made only a monthly basis. Calculate the amount that John would have
to pay each month.

Monthly repayment …………………….[1]

(c) Explain the “interest payment”

………..………………………………………………………………………………………………….

………………..……………………………………………………………………………………….[1
]

The amount paid during each repayment that contributes to the interest from the loan
amount.

BLS/EYE/2019/4E/COMP/7155/01
14

9 You are now an apprentice data-scientist and have been tasked to work on the intercepted
transmission string again.

Having recently attended an encryption class, you would like to test the following magic algorithm
on the string in an attempt to make sense of the transmission.

● Letters in the upper case are shifted +2 relative to their ASCII values
● Letters in the lower case are shifted -2 to their relative ASCII values
● Digits are replaced with the result of the following formula: (x + 6) % 10, where x is each
individual digit
● Spaces are replaced with an ampersand ‘&’

A sample portion of the transmission in string is shown below:

>> print(transmission_str)

PPj14jWLFr5iq90nsb6ezSca1 kOz xP4A6MK6hTeHPM27gpol1 fwZyuSxB0SIBeA5wfG


Lceoex533Py9dUOIr6jTQY6687Luz9gavI1DdgH96eAn9yNbnMG1o7SYgkqFew4FP9VpQPLI
87OnkFNBMoPIdh9fh3ZB 9wwiVqzRR88bhuPtdhEYLeg5hxE v7eCQfVrKNEi DsmdF0Gxv
JUs7CX0ELbSwSbAE THAwVnpT2 knIOpV3j3gtkATHNu4mI VPpdNOTbHO5h5atCJWfTICmQ
vxE9nMd3LZDDh3vv7SiaBV174zQ136d0R29dUHGyx9KKLqcqyMJz2xS5Y9KgOOyfuEwXx4ZU
ly vw EjOpr

Write an algorithm, using either pseudo-code or a flowchart to process the message using the
magic algorithm. The program must process every single character, and output the new string when
it ends.

[10]

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

BLS/EYE/2019/4E/COMP/7155/01
15

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

BLS/EYE/2019/4E/COMP/7155/01
16

……….…………………………………………………………………………………………………………

……….…………………………………………………………………………………………………………

1 transmission_str='PPj14jWLFr5iq90nsb6ezSca1 kOz
xP4A6MK6hTeHPM27gpol1 fwZyuSxB0SIBeA5wfG
Lceoex533Py9dUOIr6jTQY6687Luz9gavI1DdgH96eAn9yNbnMG1o7SYgkqFew4FP9
VpQPLI87OnkFNBMoPIdh9fh3ZB 9wwiVqzRR88bhuPtdhEYLeg5hxE
v7eCQfVrKNEi DsmdF0Gxv JUs7CX0ELbSwSbAE THAwVnpT2
knIOpV3j3gtkATHNu4mI VPpdNOTbHO5h5atCJWfTICmQ
vxE9nMd3LZDDh3vv7SiaBV174zQ136d0R29dUHGyx9KKLqcqyMJz2xS5Y9KgOOyfuE
wXx4ZUly vw EjOpr'
2 new_str='' #1m new string
3 for char in transmission_str: #1m valid loop to check all
characters
4 if char.islower(): #1m valid test condition
a. new_str += chr(ord(char)+2) #1m valid modification, #1m
correct datatype used
5 elif char.isupper(): #1m valid test condition
a. new_str += chr(ord(char)-4) #1m valid modification
6 elif char.isdigit(): #1m valid test condition
a. new_str += str((int(char)+6)%10) #1m valid modificatoin
7 elif char.isspace(): #1m valid test condition
a. new_str += '&' #1m valid modification
8 print(new_str) #valid output
9 #total possible marks: 12m

BLS/EYE/2019/4E/COMP/7155/01

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy