SST 2018 Prelim P2 Solution
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
1 2018 SEC 4 COMPUTING PRELIM PAPER 2 MARKING SCHEME Task 1 Question Answer Marks 1 ==B3*12 or =$B$3*12 or =B$3*12 or =$B3*12 1 2 1 3(a) =IF(ROW(B10)-9>$B$4, "", ROW(B10)-9) (Or equivalent) 1 3(b) =IF(B10="","",CEILING(B10/12,1) ) =IF(B11="","",CEILING(B11/12,1)) … =IF(B489="","",CEILING(B489/12,1)) (Or equivalent) 1 3(c) =IF(B10="","",ABS(PMT(C10/12,$B$4,$B$2))) (Or equivalent) 1 3(d) =IF(B10="", "", ABS(IPMT(C10/12, B10, $B$4, $B$2))) (Or equivalent) 1 3(e) In cell G10: =IF(B10="", "", E10-F10) In cell H10: =IF(B10="", "", D10-G10) (Or equivalent) 2
2 3(f) copying formulae A10:H10 to rows 11 to 489. 1 4 He should set the loan tenure to 27 years and 3 months. 1 Task 2 Question Answer Marks 5(a) size = 10 1 5(b) correct validation criterion printing feedback AND asking for input again. Insert between line 4 and 5: 2 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
3 highestTax = 0 if tax > highestTax: highestTax = tax n = employee + 1 OR highestTax = max(highestTax, tax) print("Highest tax payable is $", round(highestTax,2)) 5(d) if tax > highestTax: highestTax = tax n = employee + 1 print("Employee {} paid the highest tax.".format(n)) 1 5(e) count = 0 … if income <= 20000: tax = 0 count += 1 … print("Percentage who do not need to pay tax: {}%.".format(round(count/size*100,1))) 2 6 Correct the four highlighted parts: 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 2
4 Task 3 Question Answer Marks 7 s = 0 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)) 10
5 Task 4 Question Answer Marks 8 while True: i = input('Enter a string of digits or space:') if any([not x in '0123456789 ' for x in i]): print('Input error
Content continues in the PDF.
Related notes
- Computing o level notes Notes/Practices · 2023
- BVSS Prelim P1 MSExam Papers · 2024
- BVSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 MSExam Papers · 2024
- computing notesNotes/Practices

