BLSS 2018 Computing P2
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Text from the first pagesBOON LAY SECONDARY SCHOOL PRELIMINARY EXAMINATION 2018 Name ( ) Class Subject : COMPUTING Paper No : 2 Subject Code : 7155/02 Level : SECONDARY FOUR EXPRESS Date/Day : 28 AUGUST 2018 (TUESDAY) Time : 1130 - 1400 Duration : 2 HOUR 30 MINUTES Additional Materials: Electronic version of CARLOAN.XLSX data file Electronic version of TEXTCHECK.PY file Electronic version of JOB_ERROR.PY file 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 class in the spaces at the top of this page. Write in dark blue or black pen. 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.
2 This document consists of 6 printed pages. Task 1 Century Boon Lay Loan Service provides car loan to new car owners. The manager wants to use a spreadsheet software to record the details of the transactions in the first quarter of 2018. You are required to finish setting up the spreadsheet to record the interest earned. Open the file CARLOAN. You will see the following data. Save the file as LOAN_<your name>_<centre number>_<index number>. 1 In cell B20 enter a formula to calculate the total loan amount. [1] 2 In cell B21 enter a formula to count the number of transactions made. [1] 3 In cell B22 enter a formula to calculate the range of the number of years loaned. [1] 4 Use an appropriate function to search for the Interest Rate per Year in the Rates table and use it to complete the Interest Rate column. [2] 5 Enter a formula to calculate the simple interest payable by car owners and use it to complete the Interest Payable column. Round these values to the nearest whole number. [3]
3 6 Enter a formula, by using conditional statement(s), to identify car owners who have loaned $50,000 or more for over 5 years and put YES in the Free 1st Year Car Insurance column. Otherwise put NO in the Free 1st Year Car Insurance column. [2] Save and close your file. Task 2 The following program accepts five inputs and prints out the length of the longest input and the average length of all the inputs. An input may only contain letters, digits or symbols. longest = 0 total = 0 data = 5 for count in range(data): text = input("Please enter the text: ") if len(text) > longest: longest = len(text) total += len(text) print("The longest input length is ", longest) average_length = total/data print("Average length is ", average_length) Open the file TEXTCHECK.py Save the file as TENTEXT_<your name>_<centre number>_<index_number> 7 Edit the program so that it: (a) Accepts 10 inputs [1] (b) Determines and prints out the length of the shortest input as well [4] (c) Tests if the input included empty space, if yes, asks the user for input again. An input can only contain letters, digits or symbols. [3] Save your program. 8 Save your program as VARTEXT_<your name>_<centre number>_<index_number> Edit your program so that it works for any number of data. [2] Save your program.
4 Task 3 The following program should check which student is eligible for the job attachment programme using the following rules: ● age must be at least fourteen years ● age not more than eighteen years ● mid-year examination overall results greater than 60.0%. The program calculates the number of students who are eligible for the job attachment programme and the number rejected. When a student is rejected, all the reason(s) for rejection will be printed. The program finishes when an age of zero or a mark of zero is input. The number of students who are eligible for the job attachment and the number rejected are then printed out. There are several syntax errors and logical errors in the program. age = 0 results = float(0) rejected = 100 eligible = 0 age = int(input"Please enter student's age:" )) result = float(input("Please enter mid-year exam overall results:")) while age <> 0 and result <> 0: if age < 15 or age > 18 or result == 60: if age < 15: print("Age must be at least fourteen years") elif age > 18: print("Age must not be more than eighteen") if result == 60: print("Mid-year exam overall results must be more than 60%") rejected = rejected - 1 print("Student is NOT eligible for job attachment programme.") else: print("Student is eligible for job attachment programme.") Eligible = eligible + 1 age = int(input("Please enter student's age:" )) result = float(input("Please enter mid-year exam overall results:")) print("Number of students eligible is " eligible) print("Number of students rejected is ", rejected) Open the file JOB_ERROR.py Save the file as JOB_<your name>_<centre number>_<index_number> 9 Identify and correct the errors in the program so that it works correctly according to the rules above. [10] Save your program.
5 Task 4 You have been tasked to write a program to calculate the average number of parcels collected per week by a team of four postmen. Each postman can carry at most 10 parcels and there are 5 working days per week. The program should allow you to: ● Enter data in the format of a, b, c, d where a, b, c, d are the number of parcels collected by each postman for the day. An example is 5, 8, 10, 9 ● Only allow data entry of 0 to 10. Text message "Error – Please enter number 0 to 10" should be displayed if any invalid data is entered ● Calculate the total number of parcels collected each day ● Repeat this for a total of the five working days per week ● Find the average number of parcels collected by a postman per week rounded to the nearest whole number ● Calculate the total number of parcels collected for the week ● Display the output data on the screen. Your output must look like this: Enter parcels collected by the team: 2, 11, 5, 8 Error – Please enter number 0 to 10. Enter parcels collected by the team: 5, 8, 10, 9 Enter parcels collected by the team: 0, 3, 8, 7 Enter parcels collected by the team: 1, 3, 5, 9 Enter parcels collected by the team: 6, 10, 2, 4 Enter parcels collected by the team: 2, 1, 8, 9 Day 1 The team collected 32 parcel(s) Day 2 The team collected 18 parcel(s) Day 3 The team collected 18 parcel(s) Day 4 The team collected 22 parcel(s) Day 5 The team collected 20 parcel(s) Average number of parcels 28 Total number of parcels for the week 110
6 10 Write your program and test that it works. [10] Save your program as POST1_<your name>_<centre number>_<index_number> 11 When your program is working, use the following test data to show your test results: 5, 8, 10, 9 0, 3, 8, 7 1, 3, 5, 9 6, 10, 2, 4 2, 1, 8, 9 Take a screen shot of your results and save it as a bitmap file POSTRESULT_<your name>_<centre number>_<index_number> [5] 12 Save your program as POST2_<your name>_<centre number>_<index_number> Extend your program to identify which postman collected less than 30 parcels in the week. The additional output printed on the screen should look like this: Postman 1 collected 14 parcels this week. Postman 2 collected 25 parcels this week. [3] Save your program. 13 Save your program as POST3_<your name>_<centre number>_<index_number> Extend your program to work with any number of postmen. [2] Save your program.
7 End of Paper
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

