BLSS 2019 P2
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Text from the first pagesBOON LAY SECONDARY SCHOOL PRELIMINARY EXAMINATION 2019 Name CCA Subject : COMPUTING Paper No : 2 (Lab-based) Subject Code : 7155/02 Level : SECONDARY FOUR EXPRESS Date/Day : 26 AUGUST 2019 / MONDAY Time : 1145 - 1415 Duration : 2 HOURS 30 MINUTES Additional Materials: Electronic version of TRIATHLON.xlsx Electronic version of TEMPERATURE.py Electronic version of PARITY.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, last four digits and the ending letter of your NRIC 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 8 printed pages.
2 BLS/EYE/2019/4E/COMP/7155/02 Task 1 Mr. Kwek used a spreadsheet to keep track of the results in Boon Lay Secondary School’s annual ironman triathlon. The triathlon consists of three segments, cycling, running and swimming, and the awards are determined by the number of points each student accumulates. You are required to finish setting up the spreadsheet to display the information correctly. Open the file TRIATHLON.xlsx. You will see the following data. Save the file as TRIATHLON_<NAME>_<CCA>_<CENTRE_NUMBER>_<INDEX_NUMBER >.xlsx. 1 In cells B22:B23 enter a formula to count the number of males and females who took part in the triathlon. [1] 2 In cells J18:J20 enter a formula to calculate the average, fastest and slowest timings for running. The average timing must be rounded to 1 decimal place. [4] 3 Use an appropriate function to search for the points that each runner achieves from the Run Score table and use it to complete cells K2:K16. [2] 4 Use a conditional statement to determine whether a participant will receive a special mention. For participants who have achieved a total timing not more than 125 minutes, put Yes in the Special Mention column, otherwise put No in the Special Mention column. [1]
3 BLS/EYE/2019/4E/COMP/7155/02 5 In cells P2:P16 enter a formula to calculate the total points that each participant receives from all three events. [1] 6 In cells Q2:Q16 enter a formula to search the Points-Awards table to determine the award that each participant will receive. [1] Save and close your file. Task 2 begins on the next page.
4 BLS/EYE/2019/4E/COMP/7155/02 Task 2 The following program takes an input in Fahrenheit and converts it to its corresponding temperature in degrees Celsius. tempC = 0 tempF = 0 print("Temperature Conversion Program") while True: tempF = float(input("Please key in a temperature in Fahrenheit: ")) tempC = (tempF-32)*5/9 print(tempF, " in Fahrenheit is ", tempC, " in degrees Celsius.") if (input("Would you like to key in another temperature? (Y/N)")=="N"): print("\nHave a nice day\n") break Open the file TEMPERATURE.py Save the file as: TEMPERATURE_<NAME>_<CCA>__<CENTRE_NUMBER><INDEX_NUMBER >.py 7 Edit the program so that it: (a) Outputs an empty line after “Temperature Conversion Program” [1] (b) Calculates tempC to 1 decimal place. [2] (c) Prints out the message “This temperature is in the acceptable range” when tempC is calculated to be between 40.1°C and 44.9°C inclusive. [5] Save your program. 8 Save your program as: ANY_TEMPERATURE_<NAME>_<CCA>__<CENTRE_NUMBER><INDEX_NUMBER >.py Edit your program so that it allows the user to specify how many temperature readings he/she would like to input. [3] Save your program.
5 BLS/EYE/2019/4E/COMP/7155/02 Task 3 A parity bit is a simple form of validation for detecting errors in data transmitted over a network. In even parity, the total number of 1s in each group of 8 bits must be an even number. In odd parity, the total number of 1s in each group of 8 bits must be an odd number. The program uses the following algorithm: • Prompts the user to decide between even or odd parity • Prompts the user to key in 8 bits • Counts and outputs the number of 1s in the input • Outputs the corresponding parity bit depending on whether even or odd parity was chosen at the beginning There are several syntax and logic errors in the program. print("Parity checker") parity = ' byte = '' count1 = 1 while True: parity = int(input("Which parity would you like to use? (Even/Odd): ")) if parity == 'Even' and parity == 'Odd': break else: print("Please key in 'Even' or 'Odd'.") while True: byte = input("Please key in the 8 bits: ") for bit in byte if bits == '1': count1 == 1 print("There are ", count1, "1s in ", byte) if parity == 'Even': if count1 // 2 == 0: print("Parity bit == 1") else: print("Parity bit == 1") else: if count1%2 != 0: print("Parity bit == 1") else: print("Parity bit == 0") Open the file PARITY.py Save the file as PARITY_<NAME>_<CCA>__<CENTRE_NUMBER><INDEX_NUMBER >.py
6 BLS/EYE/2019/4E/COMP/7155/02 9 Identify and correct the errors in the program so that it works according to the rules given. Save your program. [10] Task 4 begins on the next page.
7 BLS/EYE/2019/4E/COMP/7155/02 Task 4 “Rock, Paper, Scissors” is a game that involves two players. The players use their hands to make a representation of either rock, paper or scissors simultaneously and the winner is determined by a set of rules. You have been tasked to write a program to allow two players to play this game on a computer. The program should: • Output the title of the game: “Rock, Paper, Scissors!” • Allow player 1 to input either Rock, Paper or Scissors. There must be validation present to check that only valid inputs have been keyed in. • Allow player 2 to input either Rock, Paper or Scissors. • Determine the winner of the round using the following rules: o Rock wins scissors o Scissors wins paper o Paper wins rock • Outputs the winner of each round 10 Write your program and test that it works. Save your program as: RSP_<NAME>_<CCA>__<CENTRE_NUMBER><INDEX_NUMBER >.py [10] 11 When your program is complete, test it for the following: • Test 1 – Player 1 keys in ‘rock’ • Test 2 – Player 1 keys in Rock and Player 2 keys in Paper • Test 3 – Player 1 keys in Paper and Player 2 keys in Scissors Take a screen shot of: • Test 1 and 2. Save this screenshot as: TEST12_<NAME>_<CCA>__<CENTRE_NUMBER><INDEX_NUMBER > • Test 3. Save this screenshot as: TEST3_<NAME>_<CCA>__<CENTRE_NUMBER><INDEX_NUMBER >. Save your files either in .png or .jpg format. [3]
8 BLS/EYE/2019/4E/COMP/7155/02 12 Modify your code to allow the players to determine how many rounds they would like to play. Save your program as ROUNDS_RSP_<NAME>_<CCA>__<CENTRE_NUMBER><INDEX_NUMBER >.py [2] 13 Extend your code in Q12 to: • Track and output the score at the end of each round • Output the winner after all the rounds have been completed. Save your program as TRACK_RSP_<NAME>_<CCA>__<CENTRE_NUMBER><INDEX_NUMBER >.py [3]
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

