0% found this document useful (0 votes)
10 views6 pages

SST 2018 Prelim P2 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)
10 views6 pages

SST 2018 Prelim P2 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/ 6

2018 SEC 4 COMPUTING PRELIM PAPER 2 MARKING SCHEME

Task 1

Question Answer Marks


1 1
==B3*12 or =$B$3*12 or =B$3*12 or =$B3*12

2 1

3(a) 1
=IF(ROW(B10)-9>$B$4, "", ROW(B10)-9)
(Or equivalent)

3(b) 1
=IF(B10="","",CEILING(B10/12,1) )
=IF(B11="","",CEILING(B11/12,1))

=IF(B489="","",CEILING(B489/12,1))
(Or equivalent)

3(c) 1
=IF(B10="","",ABS(PMT(C10/12,$B$4,$B$2)))

(Or equivalent)

3(d) 1
=IF(B10="", "", ABS(IPMT(C10/12, B10, $B$4, $B$2)))
(Or equivalent)
3(e) 2
In cell G10: =IF(B10="", "", E10-F10)
In cell H10: =IF(B10="", "", D10-G10)
(Or equivalent)

1
3(f) copying formulae A10:H10 to rows 11 to 489. 1

4 1

He should set the loan tenure to 27 years and 3 months.

Task 2

Question Answer Marks


5(a) size = 10 1

5(b) correct validation criterion 2


printing feedback AND asking for input again.

Insert between line 4 and 5:

while True:
try:
income = int(input("({})Annual income in $: ".format(employee+1)))
if income < 0 or income > 120000:
raise Exception
except:
print("Please enter a value from 0 to 120000!")
else:
break

OR

income = int(input("({})Annual income in $: ".format(employee+1)))


while income < 0 or income > 120000:
income = print("Please enter a value from 0 to 120000!")

5(c) 2

2
highestTax = 0

if tax > highestTax: OR highestTax =


highestTax = tax max(highestTax, tax)
n = employee + 1

print("Highest tax payable is $", round(highestTax,2))

5(d) 1
if tax > highestTax:
highestTax = tax
n = employee + 1

print("Employee {} paid the highest tax.".format(n))

5(e) 2
count = 0

if income <= 20000:
tax = 0
count += 1

print("Percentage who do not need to pay tax:
{}%.".format(round(count/size*100,1)))

6 Correct the four highlighted parts: 2


elif income <= 30000:
tax = (income-20000) * 0.02
elif income <= 40000:
tax = 200 + (income-30000) * 0.035
elif income <= 80000:
tax = 550 + (income-40000) * 0.07
else:
tax = 2800 + (income-80000) * 0.115

3
Task 3

Question Answer Marks


7 s = 0 10
count = 0

while True:
x = input('Enter a positive integer. Type "done" to finish.')

if x == "done":

break
elif not x.isdigit():

print ("Invalid input. Try again.")


else:
x = int(x)

if count == 0:
M = m = x
else:

M = max(M, x)
m = min(m, x)
s += x
count += 1

if count==0:
average = s = M = m = "NA"

average = round(s/count, 1)
print("\nYou have entered {} number(s).".format(count))

print("The sum of the number entered is {}.".format(s))


print("\nThe average of the number entered is {}.".format(average))
print("\nThe maximum of the number entered is {}.".format(M))

print("The minimum of the number entered is {}.".format(m))

4
Task 4
Question Answer Marks
8 while True: 12
i = input('Enter a string of digits or space:')
if any([not x in '0123456789 ' for x in i]):
print('Input error! Try again!')
else:
break

F = [i.count(x) for x in '0123456789 ']


B = [x for x in i.split() if sum([int(y) for y in x])>=20]

blocks = 0 if i.isspace() else 1


s = 0
count = 0
for x in range(1, len(i)-1):
if i[x]==' ' and i[x+1]!=' ':
blocks += 1

for x in '0123456789':
print('Frequency of {}: {}'.format(x, F[int(x)]))

print('\nNumber of block(s): {}'.format(blocks))

print('Block(s) with sum 20 or more:')


for i, b in enumerate(B):
print('({}) {}'.format(i+1, b))

5
Question Answer Marks
9 3
Enter : 3647 94859 8482 3209 832 45346

10 5
while True:
i = input('Enter a string of digits or space:')
if any([not x in '0123456789 ' for x in i]):
print('Input error! Try again!')
else:
break

F = [i.count(x) for x in '0123456789 ']


B = [x for x in i.split() if sum([int(y) for y in x])>=20]

blocks = 0 if i.isspace() else 1


s = 0
count = 0
for x in range(1, len(i)-1):
if i[x]==' ' and i[x+1]!=' ':
blocks += 1

for x in '0123456789':
print('Frequency of {}: {}'.format(x, F[int(x)]))

print('\nNumber of block(s): {}'.format(blocks))

print('Block(s) with sum 20 or more:')


for i, b in enumerate(B):
print('({}) {}'.format(i+1, b))

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