SST 2020 Computing P2 Solution
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
1 2020 SEC 4 COMPUTING PRELIM PAPER 2 MARKING SCHEME Task 1 Question Answer 1 =SUM(C3:C17) 2 =MAX(C3:C17)-MIN(C3:C17) 3 =C3-D3 [1 mark for correct first entry. 1 mark for all subsequent entries] 4 =VLOOKUP(F3,E$22:F$26,2,TRUE) [1 mark for correct first entry. 1 mark for all subsequent entries] 5 = -PMT(G3/12,F3*12,E3,0) [1 mark for correct first entry. 1 mark for all subsequent entries] 6 =IF(AND(E3>=28000,F3<=5),"Yes","No") [1 mark for correct first entry. 1 mark for all subsequent entries]
2 Task 2 Question Answer Marks #User sets password and tries to log into a system #Sets password that consists of at least 8 characters, #at least 1 upper case letter # Q9i Able to run Q9 with no errors [1 mark] # Q10i Able to run Task Q10 with no errors [1 mark] accept_length = False accept_uppercase = False # Q9ii Loop for user to input correct length [1 mark] # Q10ii Loop for user to input at least one uppercase [1 mark] while (accept_length == False) or (accept_uppercase == False): password = input("Please set password: ") print("Your password is : ", password) # Q9iii Printing input requirements of 8 characters with correct condition [1 mark] if len(password) < 8: print("Your password should be at least 8 characters long.") else: accept_length = True # Q10iii Correct checking of uppercase characters [1 mark] for char in password: if (ord(char) >= 65) and (ord(char) <= 90): accept_uppercase = True # Q10iv Printing input requirements of at least one uppercase with correct condition [1 mark] if accept_uppercase == False: print("Your password should consists of at least one uppercase alphabet.") #Reverse password reverse = "" #Q8i Consider each character in the password [1 mark] for char in password: reverse = char + reverse #Accept password[::-1] #Q8ii Print the password in reverse [1 mark] print("The reverse password is : ",reverse) #Log into system
3 #Q7 Change the count from 3 to 4 [1 mark] count = 4 hit = False while count > 0 and hit == False: print("Please log into the system.") print("You have {} attempt(s) left.".format(count)) user_input = input("Please enter the password: ") if user_input == password: print("You have successfully logged into the system.") hit = True else: print("You did not enter the correct password.") count -= 1 if count == 0: print("You are locked out of the system.")
4 Task 3 Question Answer Marks DS = input("DD MM YYYY:").split() MM, Yr = int(DS[1]), int(DS[2]) } must individually cast into int, syntax error [1] leap_yr = False } Uppercase F, syntax error [1] if (Yr % 4) == 0: if (Yr % 100) == 0: if (Yr % 400) == 0: leap_yr = True else: leap_yr = True } Indented to 2nd if statement, syntax error [1] max_day = 31 if MM in [4, 6, 9, 11]: } 9 (Sept) instead of 8(Aug), logic error [1] max_day = 30 elif MM == 2: } == symbol instead of =, synt
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

