Pathlight 2022 4E Computing Prelim P2 Mark Scheme
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Text from the first pages4E Computing Paper 2 PRELIM 2022 2022 PRELIMINARY EXAMINATION Secondary 4 Express Computing Paper 2 ANSWERS AND MARKING SCHEME Question Answer Marks 1 =TODAY() 1 2 =YEAR($B$1) – RIGHT(C3,4) in cell D3 1 Accept MID function: =YEAR($B$1) – MID(C3,6,4). Use of YEAR() function and absolute cell referencing to copy formula to rest of Number of Years Joined 1 3 =VLOOKUP(D3,$A$17:$C$20,3,TRUE)*F3 1 One mark for working top formula, one mark for the rest = VLOOKUP(D4,$A$17:$C$20, 3, TRUE)*F4 = VLOOKUP(D5,$A$17:$C$20, 3, TRUE)*F5 .. .. VLOOKUP(D14,$A$17:$C$20, 3, TRUE)*F14 1 4 =F3-G3 =F4-G4 … =F14-G14 1 5 One mark for working top formula, one mark for the rest =IF(AND(D3>=3,E3="Yes"),"Yes","No") =IF(AND(D4>=3,E4="Yes"),"Yes","No") … … =IF(AND(D14>=3,E14="Yes"),"Yes","No") 2 6 Conditional Formatting applied to range with correct formula and colour 2
4E Computing Paper 2 PRELIM 2022 Question Answer Marks 7 8 Program edited: member_no = int(input("Number of people: ")) minimum_age = 14 for i in range(member_no): name = input("Name of person: ") age = int(input("Age of person: ")) ## if age >= minimum_age: ## print("Person is old enough.") ## else: ## print("Person is not old enough.") healthcheck = input("Any medical condition? (Y/N) ") if healthcheck == "Y" or healthcheck == "y": fit = False else: fit = True if age >= minimum_age and fit == False: print("The person is not fit enough.") elif age < minimum_age and fit == True: print("The person is not old enough.") elif age < minimum_age and fit == False: print("The person is not fit enough and not old enough.") else: print("The person is old enough and fit enough.") 1 1 1 1 1 1 9 member_no = int(input("Number of people: ")) minimum_age = 14 fit_list = [] #initialise list for i in range(member_no): name = input("Name of person: ") age = int(input("Age of person: ")) healthcheck = input("Any health issues? (Y/N) ") if healthcheck == "Y" or healthcheck == "y": fit = False else: fit = True if age >= minimum_age and fit == False: print("The person is not fit enough.") elif age < minimum_age and fit == True: print("The person is not old enough.") elif age < minimum_age and fit == False: print("The person is not fit enough and not old enough.") else: print("The person is old enough and fit enough.") fit_list = fit_list + [name] #append to list for person in fit_list: print(person) #output list of fit and old enough 1 2 1
4E Computing Paper 2 PRELIM 2022 Question Answer Marks 10 # Task 3 solution # Variable declarations count = 0 while count < 10: year = int(input("Enter a year: ")) if year % 400 == 0: isLeapYear = True elif year % 100 == 0: isLeapYear = False elif year % 4 == 0: isLeapYear = True else: isLeapYear = False if isLeapYear: print(year, "is a leap year.") else: print(year, "is not a leap year.") #syntax & logic count = count + 1 indentation 1 1 1 1 1 1 1 1 1 1 Question Answer Marks 11 Program: input eight_bits (as string) 2 Variable set up for parity_bit 1 Use of loop to keep checking for input until blank line is entered 2 Use of user-defined function for computing even parity bit and returning value Definition Argument Return value 3 Correct calculation for counting number of ones and zeroes 2 Clear and correct output of parity bit (whether 0 or 1) 1 Display appropriate error message when user enters something other than 8 bits 1 Question Answer Marks 12 Test: three lines of output (3) ( –1 for each line with an error) 3 Test 1: 01010011 Parity bit is 0 Test 2: 1100000 Please enter 8 bits. Try again. Followed by: 11000001 Parity bit is 1
4E Computing Paper 2 PRELIM 2022 Question Answer Marks 13 Extend: allows user to choose even or odd parity 1 Extend: correct user defined function for computing parity bit using odd parity 2 Correct output ( –1 for each line with an error) 2 Task 4 Sample solution Question 11 #compute even parity for sets of 8 bits entered by user. #even_parity udf def even_parity(number): ones = number.count("1") if ones % 2 == 0: return 0 else: return 1 #read first line of input line = input("Enter 8 bits: ") #continue looping until a blank line is entered while line != "": #ensure that the line has a total of 8 zeros and 1's and exactly 8 characters if line.count("0") + line.count("1") != 8 or len(line) != 8: #display an appropriate error message print ("Please enter 8 bits. Try again.") else: #call user-defined function parity = even_parity(line) print("The parity bit should be", parity) line = input("Enter 8 bits: ") Question 12 screenshot
4E Computing Paper 2 PRELIM 2022
4E Computing Paper 2 PRELIM 2022 Question 13 def odd_parity(number): ones = number.count("1") if ones % 2 == 1: return 0 else: return 1 THE END
Content continues in the PDF. Download PDF
Related notes
- SST (for revision practice) 2024 S3 Computing EOY P2 QP_FinalExam Papers · 2024
- Computing o level notes Notes/Practices · 2023
- BVSS Prelim P1 CPExam Papers · 2024
- BVSS Prelim P1 MSExam Papers · 2024
- CWSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 MSExam Papers · 2024
- computing notesNotes/Practices
- SST 2024 Prelim Paper 1 [revised for 2025] Exam Papers · 2024
- SST 2024 Prelim Paper 1 Ans [revised for 2025] Exam Papers · 2024
- [Notes for Computing] Heavily Compressed TextbookNotes/Practices · 2025
- [Notes for Computing] All Definitions/ TermsNotes/Practices · 2025
- (Notes) Heavily Compressed TextbookNotes/Practices · 2025
- See all Computing notes

