BLSS 2018 Computing P2 Solution
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Text from the first pages1 MARKING SCHEME & TOS Subject: Computing Paper : 2 - Practical Level : Secondary FOUR Express Exam : Preliminary Examinations Year : 2018 Marking Scheme Qn Answer Marks allocated Remarks Q1 =SUM(B4:B18) 1 Q2 =COUNT(B4:B18) or =COUNT(A4:A18) 1 Q3 =MAX(C4:C18)-MIN(C4:C18) 1 Q4 One mark for working first row formula One mark for the rest =VLOOKUP(C4,$D$25:$F$28,3,TRUE) 1 1 Q5 Two mark for correct formula One mark for using ROUND function =ROUND(B4*C4*D4,0) 2 1 Q6 One mark for correct IF formula One mark for use of AND =IF(AND(B4>=50000, C4>5),"YES","NO") 1 1 Total for Task 1 10 Q7a data = 10 1 Q7b shortest = 100 # Declare variable and assign a high value or initializing var shortest with the length of the first input 1 elif len(text) < shortest: shortest = len(text) 2 print("The shortest input length is ", shortest) 1 Q7c while " " in text: #Check if input contains spacing text = input("Please enter the text again: ") WHILE loop used 1 1 1 Q8 data = int(input("Enter the number of data ")) # input Typecast to integer 1 1 Total for Task 2 10
2 Qn Answer Marks allocated Remarks Q9 rejected = 0 # change to 0 1 age = int(input("Please enter student's age:" )) # corrected syntax error 1 while age != 0 and result != 0: # <> to != 1 if age < 14 or age > 18 or result <= 60: # Change 15 to 14, Change == to <= Both instant below must be changed to get the marks if age < 14: # Change 15 to 14 if result <= 60: #Change == to <= 2 rejected = rejected + 1 #Change - to + 1 else: #indentation 1 eligible = eligible + 1 # Eligible to eligible 1 age = int(input("Please enter student's age:" )) #Change indentation 1 print("Number of students eligible is ", eligible) #Added , # corrected syntax error 1 Total for Task 3 10 Q10 Read and store user input 2 Validation for input 2 Variable set up 1 Use of loops for 4 postmen for 5 days 2 Correct calculation and output of number of parcels collected each day 1 Correct calculation and output of average 1 Correct calculation and output of total 1 Q11 Test: 12 lines of output 3 Output matches stored program 2 Q12 Extend: Correct output 3 Q13 Extend: Correct Input Entry 2 Total for Task 4 20 TOTAL 50
3 Sample Python Code Answers for Task 2 to Task 4
4 Task 2 – Q7 longest = 0 shortest = 100 # Declare variable and assign a high value total = 0 data = 10 # Change value to 10 for count in range(data): text = input("Please enter the text: ") while " " in text: #Validation to check if input contains spacing text = input("Please enter the text again: ") if len(text) > longest: longest = len(text) elif len(text) < shortest: # Added condition to check and store shortest length shortest = len(text) total += len(text) print("The longest input length is ", longest) print("The shortest input length is ", shortest) average_length = total/data print("Average length is ", average_length) ------------------------------------------------------------------------------------------------------------------------------ Task 2 – Q8 longest = 0 shortest = 100 total = 0 data = int(input("Enter the number of data input: ")) #User entry for count in range(data): text = input("Please enter the text: ") while " " in text: text = input("Please enter the text again: ") if len(text) > longest: longest = len(text) elif len(text) < shortest: shortest = len(text) total += len(text) print("The longest input length is ", longest) print("The shortest input length is ", shortest) average_length = total/data print("Average length is ", average_length) Task 3 – Q9
5 age = 0 results = float(0) rejected = 0 # change to 0 eligible = 0 age = int(input("Please enter student's age:" )) #Added ( result = float(input("Please enter mid-year exam overall results:")) while age != 0 and result != 0: # <> to != if age < 14 or age > 18 or result <= 60: # Change 15 to 14, Change == to <= if age < 14: # Change 15 to 14 print("Age must be at least fourteen years") elif age > 18: print("Age must not be more than eighteen") if result <= 60: #Change == to <= print("Mid-year exam overall results must be more than 60%") rejected = rejected + 1 #Change - to + print("Student is NOT eligible for job attachment programme.") else: #indentation print("Student is eligible for job attachment programme.") eligible = eligible + 1 # Eligible to eligible age = int(input("Please enter student's age:" )) #Change indentation result = float(input("Please enter mid-year exam overall results:")) print("Number of students eligible is ", eligible) #Added , print("Number of students rejected is ", rejected)
6 Task 4 – Q10 # Practical Paper - Task 4 day_list=[] # A list to store all the inputs week_total = 0 # Variable for total number of parcels collected by 4 postmen in 5 days week_list =[] # A list to store the total for each day day = 1 # counter for day while day <= 5: #Loop to capture 5 days of data day_total = 0 # Variable for number of parcels collected in a day parcel = input("Enter parcels collected by the team: ") # User input parcel_list = parcel.split(',') #split the string input into a list # Validation of data valid = True for item in parcel_list: # Loop thru the list to check for valid input, 0 to 10 if int(item)<0 or int(item)>10: print("Error – Please enter number 0 to 10.") valid = False # Set to False to indicate data is not valid, note that the number of day remains break if valid == True: day_list += [parcel_list] #Added to day_list for x in range(4): # Run the loop 4 times to add the total for the day day_total += int(parcel_list[x]) week_list += [day_total] #Append the total for the day to the week list week_total += day_total #Add to the total of the day to the total of the week day +=1 #Increase the counter for day for i in range(5): #loop to generate output print("Day", i+1, "\tThe team collected", week_list[i], "parcel(s)") print("\n") print("Average number of parcels\t\t", round(week_total/4)) print("Total number of parcels for the week\t", week_total)
7 Task 4 – Q12 # Extension print("\n") for i in range(4): # for each postman postman_total = 0 for j in range(5): #for 5 days postman_total += int(day_list[j][i]) if postman_total < 30: #Print only if the parcels collected is more than 30 print("Postman",i+1,"collected", postman_total, "parcels this week.") Task 4 – Q13 day_list=[] # A list to store all the inputs week_total = 0 # Variable for total number of parcels collected by x number of postmen in 5 days week_list =[] # A list to store the total for each day day = 1 # counter for day num_postman= int(input("Enter the number of postmen in the team:")) while day <= 5: #Loop to capture 5 days of data day_total = 0 # Variable for number of parcels collected in a day parcel = input("Enter parcels collected by the team: ") # User input parcel_list = parcel.split(',') #split the string input into a list # Validation of data valid = True for item in parcel_list: # Loop thru the list to check for valid input, 0 to 10) if int(item)<0 or int(item)>10: print("Error – Please enter number 0 to 10.") valid = False break if valid == True: day_list += [parcel_list] #Added to day_list for x in range(num_postman): # Run the loop x times (number of postmen) to add the total for the day day
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

