2021 BLSS Computing P2
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
BLS/PRELIM/2021/4E/COMP/7155/02 BOON LAY SECONDARY SCHOOL PRELIMINARY EXAMINATION 2021 Name CCA Subject : COMPUTING Paper No : 2 (LAB-BASED) Subject Code : 7155/02 Level : SECONDARY FOUR EXPRESS Date/Day : 15th SEPTEMBER 2021 / WEDNESDAY Time : 0815 – 1045 Duration : 2 HOURS 30 MINUTES Additional Materials: Electronic version of Total Residents (2010-2019).xlsx Electronic version of HANGMAN.py Electronic version of NUMBER.py Electronic version of Insert 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/2021/4E/COMP/7155/02 Task 1 The figure below shows the total residents in Singapore between 2010 and 2019. Open the file Total Residents (2010-2019).xlsx Save the file as Total Residents (2010-2019)_INDEX_NAME.xlsx. 1 In cell M24, use vlookup() to find out the total number of residents in Singapore between 30-34 years old in 2016. [2] 2 In cell M22, use hlookup() to find out the total number of residents in Singapore between 5-9 years old in 2011. [2] 3 In cells C19 to L19, calculate the number of residents who are between the ages of 0 and 19 years old for each year. [2] 4 In cells N4 to N17, calculate the average number of residents for each age group between 2010 and 2019 inclusive. [2] 5 In cells C4 to L4, use conditional formatting to highlight years where the total residents between 0 and 4 years old was below the average calculated in cell N4. [2] Save and close your file.
3 BLS/PRELIM/2021/4E/COMP/7155/02 Task 2 A hangman game is played by allowing the user to guess a word, one character at a time. A version of the game is implemented in the code shown below. import random word_list = ['cup','milk','car','bus','bird','song'] chosen_word = word_list[random.randint(0,len(word_list))] #print(chosen_word) grid = [] for i in range(len(chosen_word)): grid.append("_") while "_" in grid: print(grid) user = input("What's your guess? : ") if user in chosen_word: print("{} is in the word!".format(user)) grid[chosen_word.index(user)] = user else: print("not found") print("try again") print() print("Congratulations!") Open the file HANGMAN.py Save the file as HANGMAN_IND
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

