BLSS Paper 2[QN][PRINT]
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Text from the first pagesBLS/PRELIM/2022/4E/COMP/7155/02 BOON LAY SECONDARY SCHOOL PRELIMINARY EXAMINATION 2022 Name CCA Subject : COMPUTING Paper No : 2 (LAB-BASED) Subject Code : 7155/02 Level : SECONDARY FOUR EXPRESS Date/Day : 26 AUGUST 2022 / FRIDAY Time : 0945 – 1215 Duration : 2 HOURS 30 MINUTES Additional Materials: Electronic version of T1_MOBILE_PLANS.xlsx Electronic version of T2_BALANCER.py Electronic version of T3_PARITY_INDEXNO_NAME.py Electronic version of Quick Reference Glossary READ THESE INSTRUCTIONS FIRST Before you start your exam, check that you have received the correct paper and the number of printed pages are correct. Write your name, index number, and CCA in the spaces at the top of this page. Answer all questions All tasks must be done in the computer laboratory. You are not allowed to bring in or take out any pieces of work or materials on paper or electronic media or in any other form. Programs are to be written in Python. Save your work using the file name given in the question as and when necessary. The number of marks is given in brackets [ ] at the end of each question or part question. The total number of marks for this paper is 50. This document consists of 6 printed pages.
2 BLS/PRELIM/2022/4E/COMP/7155/02 Task 1 Table A2:G38 shows the number of people in Singapore with subscriptions for 2G, 3G and 4G mobile plans between 2016 and 2018. Open the file T1_MOBILE_PLANS.xlsx 1 In cells B3:B26, use vlookup() to fill in the number of 2G subscriptions for each respective month from January 2016 to December 2017 by looking up the data in table J2:J27. [2] 2 In cells E3:E38, sum up the total number of people with 2G, 3G and 4G subscriptions in each month. [1] 3 In cells F3:F38, use hlookup() to fill in the population for each corresponding year in the row by looking up the data in J29:J31. [2] 4 In cells G3:G38, determine the percentage of the total population who own either a 2G, 3G or 4G subscription in that month. Round your answer to 2 decimal places. [3] 5 In cells H3:H38, determine if there are more people who own 4G subscriptions than 3G subscriptions. Display a “T” if it is true and “F” if it is false in the month. [2] Save your file as T1_MOBILE_PLANS_INDEXNO_NAME.xlsx and close your file.
3 BLS/PRELIM/2022/4E/COMP/7155/02 Task 2 A program was written to determine if two strings are balanced. Two strings are considered balanced if all the characters in the second string can be found inside the first string, regardless of the order and number of appearances. while True: print("Welcome to the string balancer") st1 = input('string 1: ') st2 = input('string 2: ') check = True for char in st2: if char not in st1: check = False if check == True: print("Strings are balanced") else: print("Strings are not balanced") if input("again? (y/n): ")!= 'y': break Open the file T2_BALANCER.py Modify the program such that 7 it outputs the length of st1 and st2 after each of them has been keyed in. [3] 8 it compares the length of both strings and outputs which string is longer. [2] 9 accepts both “y” and “Y” when it prompts the user if they would like to compare another set of strings. [2] Save your work as T2_Balancer_01_INDEXNO_NAME.py. Save a copy of your file as T2_Balancer_02_INDEXNO_NAME.py 10 Modify your program such that it stores st1 and st2 in a list instead of two separate variables. Modify the rest of the program such that it uses the new list at appropriate junctures. [3] Save your work.
4 BLS/PRELIM/2022/4E/COMP/7155/02 Task 3 11 The code below was written to determine the parity bit for a given 7-bit binary word. In a system using even parity, the total number of ‘1’s in a 8-bit word must be even. A 7-bit binary word is entered and the final 8 th bit is determined by counting the number of ‘1’s in the original 7 bits. If the original 7 bits contains an even number of ‘1’s, the parity bit is 0. If the original 7 bits contains an odd number of ‘1’s, the parity bit is 1. Open the file T3_PARITY_INDEXNO_NAME.py There are some errors in the code. Identify and correct the errors so that it functions according to the description. Notes: You may assume that the input for word is always correct. [10]
5 BLS/PRELIM/2022/4E/COMP/7155/02 Task 4 A program has been commissioned to generate some statistics for a list of numbers that needs to be input by the user. 12 Write a program that fulfils the following specifications: • Displays an appropriate welcome message for the program • Asks the user to input some numbers. The number can either be input in the same string all at once, or one at a time. The sample below shows all the numbers being entered in a single input. • Output the average of the list of numbers • You must make use of at least three functions including the following: Function (noun) Function (verb) main() this is the main program user_input() Prompts the user to input numbers and returns a list of numbers to main() average() Calculates the average of the numbers in the list and returns the average to main() Save your program as T4_SIMPLENUM_INDEXNO_NAME.py A sample run of the code is shown below: Sample 1 Sample 2 [10]
6 BLS/PRELIM/2022/4E/COMP/7155/02 13 When your program is complete, input the following numbers as tests for your program and take screenshots of the program. • Test 1 Input numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Save this screenshot as: T4_TEST1_INDEXNO_NAME • Test 2 Input numbers: 10, 20, 30, 40, 50 Save this screenshot as: T4_TEST2_INDEXNO_NAME Save your files either in .png or .jpg format. [2] Save your program as T4_SIMPLENUM_INDEXNO_NAME.py 14 Extend your code to: • output the maximum and minimum numbers in the list • implement a check to ensure that the inputs are valid digits before converting them to the necessary data types. [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 MSExam Papers · 2024
- BVSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 CPExam Papers · 2024
- CWSS Prelim P1 MSExam Papers · 2024
- computing notesNotes/Practices
- SST 2024 Prelim Paper 1 Ans [revised for 2025] Exam Papers · 2024
- SST 2024 Prelim Paper 1 [revised for 2025] Exam Papers · 2024
- [Notes for Computing] All Definitions/ TermsNotes/Practices · 2025
- [Notes for Computing] Heavily Compressed TextbookNotes/Practices · 2025
- All Computing Terms/DefinitionsNotes/Practices · 2025
- See all Computing notes

