2018 SRSS P2 Answers
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
1 Marking Scheme for COMP Prelim Practical Exam P2 2018 Name : __________________________ Class: ______ Task 1 – Simple program / String Manipulation No Description 1. =COUNTA(A4:A24) OR COUNT(B4:B24) 2. =AVERAGE(B4:B24) 3. =MAX(B4:B24)-MIN(B4:B24) 4. In the top formula, 1 mark for the calculation, 1 mark for rounding and 1 mark for the rest =ROUND(D4 / (POWER(C4,2)),1) =ROUND(D5 / (POWER(C5,2)),1) =ROUND(D6 / (POWER(C6,2)),1) ….. =ROUND(D23 / (POWER(C23,2)),1) =ROUND(D24 / (POWER(C24,2)),1) 5. 1 mark for working top formula, 1 mark for the rest =VLOOKUP(E4,$F$32:$G$35,2,TRUE) =VLOOKUP(E5,$F$32:$G$35,2,TRUE) =VLOOKUP(E6,$G$6:$H$14,2,TRUE) … = VLOOKUP(E23,$F$32:$G$35,2,TRUE) = VLOOKUP(E24,$F$32:$G$35,2,TRUE) 6. 1 mark for working top formula, 1 mark for the conditional formatting =IF(F4="Healthy weight","YES", "NO") OR =IF(F4=$G$33,"YES", "NO") OR using =IF(AND(E4>=18.5,E4<23) , “YES”, “NO”) Task 2 – Modify/Edit existing program 7. a) ppl = 50 b) count = 0 if age < 18: count = count + 1 print("Number of people below 18 years old: ", count) c while age < 15 or age > 65: age = int(input("Enter age between 15 to 65 : ")) 8. ppl=int(input("Enter number of people : ")) Task1 (10) Task2 (10) Task3 (10) Task4 (20) Total (50)
2 Task 3 – Identify and correct errors in existing program 9. age = 0 exp = 0 pdvl = "N" citizen = "N" qualify = 0 #error : missing this statement rejected = 0 age = int(input("Please enter your age " )) exp = int(input("Please enter years of driving experience " )) pdvl = input("Do you hold a Private Hire Car Driver Vocational License (PDVL): (Y/N) ") citizen = input("Are you a Singapore Citizen (Y/N) ") #error : no cast while age != 0: #error : age == 0 if age < 21 or exp < 2 or pdvl == "N" or citizen == "N": #error:exp > 2 if age < 21: #error : age <= 21 print("You are too young to drive") if exp < 2: print("You do not have enough driving experience") if pdvl == "N": print("You need to obtain a PDVL license first") if citizen == "N": #error : incorrect else print("You have to be a Singapore Citizen") rejected += 1 #error : rejected -= 1 else: #error : incorrect elif print("You qualify to be a GRAB driver ") qualify = qualify + 1 age = int(input("Please enter your age " )) exp = int(input("Please enter years of driving experience " )) pdvl = input("Do you hold a Private Hire Car Driver Vocational License (PDVL): (Y/N) ") citizen = input("Are you a Singapore Citizen (Y/N) ") #error:missing line print("Number of people rejected ", rejected) #error: incorrect variable qualify print("Number of people qualified ", qualify) Task 4 – Develop/Write a program 10. total=0 threedays_total = [0, 0, 0] for day in range(3): daytotal = 0.0 for loc in range(
Content continues in the PDF.
Related notes
- Computing o level notes Notes/Practices · 2023
- BVSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 MSExam Papers · 2024
- BVSS Prelim P1 MSExam Papers · 2024
- computing notesNotes/Practices

