SFSS 4EX Computing Prelim QP2 MS 2022
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Text from the first pagesSPRINGFIELD SECONDARY SCHOOL “BETTER SELF FOR BETTER TOMORROW” Preliminary Examination 2022 COMPUTING 7155/02 Paper 2 Secondary 4 Express / 5 Normal Academic MARKING GUIDE FOR TEACHERS 2 hours 30 minutes MAXIMUM MARK : 50 This document consists of 7 printed pages.
2 Task 1 1 =MID(A4,2,3) Formula for entire column ----- [1] [2] 2 =SUM(E4:E11) ----- [1] [1] 3 =SUMIF(C4:C11,"Electric",E4:E11) ----- [1] [1] 4 =(D4-VLOOKUP(C4,$A$19:$B$21,2,FALSE))*E4 Correct VLOOKUP search ----- [1] Correct formula for calculating Revenue ----- [1] [2] 5 =IF(F4=MAX($F$4:$F$11),"1st","") Correct formula and “1st” indicated on the correct cell ----- [1] All other cells empty ----- [1] [2] 6 =$F4=MIN($F$4:$F$11) Correct row highlighted Correct rule description ----- [1] Correct cell range selected ----- [1] [2]
3 [Turn Over Task 2 7 weight = float(input("Enter the weight of baggage: ")) while weight > 50: #1mark weight = float(input("Passengers are not allowed to carry more than 50 kg of baggage. Please re-enter the weight of baggage: ")) #1mark if weight >= 20 and weight <= 30: cost = (weight - 20) * 20 elif weight > 30: cost = 200 + (weight - 30) * 25 else: cost = 0 print("The excess baggage cost is $", cost) [2] 8 member = input("Are you a member with the airline? (Y/N): ") #1 mark weight = float(input("Enter the weight of baggage: ")) while weight > 50: weight = float(input("Passengers are not allowed to carry more than 50 kg of baggage. Please re-enter the weight of baggage: ")) if weight >= 20 and weight <= 30: cost = (weight - 20) * 20 elif weight > 30: cost = 200 + (weight - 30) * 25 else: cost = 0 if member == 'Y': cost = cost * 80/100 #1 mark print("Thank you for being a member of ABC airline.") #1 mark print("The excess baggage cost is $", cost) [3]
4 9 passenger = int(input("Enter the number of passenger: ")) #1 mark totalweight = 0 # totalcost = 0 #1 mark for i in range(passenger): #1 mark member = input("Are you a member with the airline? (Y/N): ") weight = float(input("Enter the weight of baggage: ")) while weight > 50: weight = float(input("Passengers are not allowed to carry more than 50 kg of baggage. Please re-enter the weight of baggage: ")) if weight >= 20 and weight <= 30: cost = (weight - 20) * 20 elif weight > 30: cost = 200 + (weight - 30) * 25 else: cost = 0 if member == 'Y': cost = cost * 80/100 print("Thank you for being a member of ABC airline.") print("The excess baggage cost is $", cost) totalweight = totalweight + weight # totalcost = totalcost + cost #1 mark print("The total weight of baggage for the flight is {}kg and the total excess baggage cost collected is ${}.".format(totalweight, totalcost)) #1 mark [5]
5 [Turn Over Task 3 10 import math #1) random while true: #2)True dice_list = [] for i in range(2): input("Player {}, press enter to roll the three dice".format(i+1)) dice = {0}*3 #3)[0] for j in range(3): dice[j] = random.randint(0,6) #4) (1,6) dice_list.eppend(dice) #5) append print("Player {}, dice = {}" .format(i,dice)) #6) i+1 if max(dice_list[0]) > max(dice_list[1]): print("Player 1 wins!") elif max(dice_list[0]) = max(dice_list[1]): #7) == print("No winners!") elif: #8) else print("Player 2 wins!") play = input("Play again? (Y/N): ").isupper()#9) .upper() if play == 'N': print("Thank you for playing, goodbye!") break: #10) remove ":" * 1 mark for each correction. [10]
6 Task 4 11 MYCARPLATE1 User defined function – [1] Checksum calculation – [4] Checking / assigning of suffix – [2] Return value – [1] Call for sample execution – [1] Sample solution: def carplate(plate): weightsum = ord(plate[2]) - 65 number = plate[3:] for i in number: weight = int(i)*9 weightsum += weight checksum = weightsum%26 suffix = chr(checksum+65) return suffix print(carplate('SVA123')) print(carplate('SVM9918')) [9] 12 MYCARPLATE2 Updated weight – [3] Sample solution def carplate(plate): count = 0 weightsum = ord(plate[2]) - 65 number = plate[3:] for i in number: weight = int(i)*(4-count) weightsum += weight count += 1 checksum = weightsum%26 suffix = chr(checksum+65) return suffix print(carplate('SVZ6513')) [3]
7 [Turn Over 13 MYCARPLATE3 Check if input consist of a suffix – [3] Check if the input suffix matches the calculated one – [3] Output the validity of the car license plate – [2] Sample solution def carplate(plate): count = 0 weightsum = ord(plate[2]) - 65 if plate[-1].isalpha(): number = plate[3:len(plate)-1] else: number = plate[3:] for i in number: weight = int(i)*(4-count) weightsum += weight count += 1 checksum = weightsum%26 suffix = chr(checksum+65) if plate[-1].isalpha(): if suffix == plate[-1]: print("Car license plate is valid.") else: print("Car license is plate invalid.") return suffix print(carplate('SVZ6513R')) [8]
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

