2021 MSHS Computing P2 Solutions
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Class/ Index Number / Centre Number/ ‘O’ Level Index Number / Name MARIS STELLA HIGH SCHOOL PRELIMINARY EXAMINATION SECONDARY FOUR COMPUTING 7155/02 Paper 2 Practical (Lab-based) 20 August 2021 2 hours 30 mins Additional Materials: Electronic version of REGISTER.XLSX file Electronic version of PRODUCT.PY file Electronic version of GUESS.PY file Insert Quick Reference for Python READ THESE INSTRUCTIONS FIRST MARK SCHEME For Examiner’s Use This document consists of 7 printed pages. 50 Thumb drive No:
2 Task 1 Question Answer Marks 1 Age =$C$25-C3 =$C$25-C4 =$C$25-C5 =$C$25-C6 =$C$25-C7 =$C$25-C8 =$C$25-C9 1 Question Answer Marks 2 Category =VLOOKUP(D3,$K$4:$L$6,2,1) =VLOOKUP(D4,$K$4:$L$6,2,1) =VLOOKUP(D5,$K$4:$L$6,2,1) =VLOOKUP(D6,$K$4:$L$6,2,1) =VLOOKUP(D7,$K$4:$L$6,2,1) =VLOOKUP(D8,$K$4:$L$6,2,1) =VLOOKUP(D9,$K$4:$L$6,2,1) =VLOOKUP(D10,$K$4:$L$6,2,1) =VLOOKUP(D11,$K$4:$L$6,2,1) =VLOOKUP(D12,$K$4:$L$6,2,1) 2 Question Answer Marks 3 Password =CONCATENATE(LEFT(B3,2),LEN(B3),LEFT(F3,1)) =CONCATENATE(LEFT(B4,2),LEN(B4),LEFT(F4,1)) =CONCATENATE(LEFT(B5,2),LEN(B5),LEFT(F5,1)) =CONCATENATE(LEFT(B6,2),LEN(B6),LEFT(F6,1)) =CONCATENATE(LEFT(B7,2),LEN(B7),LEFT(F7,1)) =CONCATENATE(LEFT(B8,2),LEN(B8),LEFT(F8,1)) =CONCATENATE(LEFT(B9,2),LEN(B9),LEFT(F9,1)) 2 Question Answer Marks 4 Student Total =COUNTIF($F$3:$F$23,J10) =COUNTIF($F$3:$F$23,J11) =COUNTIF($F$3:$F$23,J12) 2 Question Answer Marks 5 Total =M16*L16 =M17*L17 1
3 =M18*L18 =M19*L19 Question Answer Marks 6 =SUMIF($J$16:$J$24,M9,$N$16:$N$24) =SUMIF($J$16:$J$24,M10,$N$16:$N$24) =SUMIF($J$16:$J$24,M11,$N$16:$N$24) 2
4 Task 2 Question Answer 7(a) mod = totalcount%11 7(b) if mod == 10: mod = "X" 7(c) CHECKDIGITS = ["1","2","3:","4","5","6","7","8","9","0","X"] while not(len(number)==9 and (number[:-1].isdigit() and number[-1]in CHECKDIGITS)): # 1m for loop, 1m for length check, 1m for format check if len(number)!=9: print("Incorrect length. Only length of 9 allowed.") if not number[:-1].isdigit(): print("First 8 data should only be digits.") if not (number[-1]in CHECKDIGITS): print("Last data should be either a digit or 'X'") number = input("Please re-enter product number: ") # 1m 8 repeat = "Y" while repeat == "Y": repeat = input("Continue with another product code (Y/N)? ").upper() MYPRODUCTCODE.PY WEIGHTS=[3,4,6,8,4,3,5,5] CHECKDIGITS = ["1","2","3","4","5","6","7","8","9","0","X"] #adding validation of length check and format check 4m repeat = "Y" #1m for setting variable while repeat == "Y": #1m for proper loop condition number = input("Please enter product number: ") while not(len(number)==9 and (number[:-1].isdigit() and number[-1]in CH
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

