BVSS 2018 P2
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Text from the first pagesName: _____________________________ ( ) Class: _____ Thumb Drive : _____ COMPUTING 7155/2 Paper 2 Practical (Lab-based) 29 Aug 2018 2 hour 30 minutes Additional Materials: Electronic version of CREDITLOAN.XLSX data file Electronic version of ITEMCATEGORIES.PY file Electronic version of ISBNCHECKDIGIT.PY file Insert Quick Reference Glossary READ THESE INSTRUCTIONS FIRST Do not open this booklet until you are told to do so. Write your name, index number, and class in the spaces provided 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 question paper consists of 7 printed pages. Answer all questions BUKIT VIEW SECONDARY SCHOOL PRELIMINARY EXAMINATION 2018 Secondary 4 Express BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL BUKIT VIEW SECONDARY SCHOOL 50 O-Level Candidate Index No : ____________
2 Task 1 Horizon Credit Pte Ltd uses spreadsheet software to record the amount of money loaned and how many months the money will be loaned. The borrowers will repay the loan in a lump sum at the end of the loan period. Interest is compounded monthly. You are required to finish setting up the spreadsheet to record the lump sum amount that will be paid by the borrowers. Open the file CREDITLOAN. 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 amount loaned. [1] 2 In cell B21, enter a formula to count how many loans have been made. [1] 3 In cell B22, enter a formula to calculate the range of number of months 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 Borrower Interest Rate column. [2] 5 Enter a formula to calculate the lump sum payable for borrowers and use it to complete the Lump Sum Amount Payable column. Round these values to the nearest whole number. [3] 6 Use a conditional statement, to identify those borrowers who have borrowed $2000 or more for over 12 months and put YES in the Check Credit History column. Otherwise, put NO in the Check Credit History column. [2] Save and close your file.
3 Task 2 A small store sells 15 items in a day. The categories of items include drinks, sandwiches and cakes. Each item sold is identified by a 3-digit code. All item codes which start with 0 are drinks category. All item codes which start with 1 are sandwiches category. All item codes which start with 2 are cakes category. Item Code Category Name 000 to 099 drinks 100 to 199 sandwiches 200 to 299 cakes The following program accepts the 3-digit code for the items sold in a day. It calculates the number of items sold in each category. drinks_category = 0 sandwiches_category = 0 cakes_category =0 items = 15 for i in range (items): item_string = input("Enter the item code ") item_code = int(item_string) if item_code < 100: drinks_category = drinks_category + 1 elif item_code < 200: sandwiches_category = sandwiches_category + 1 else : cakes_category = cakes_category + 1 print ("The number of drinks, sandwiches and cakes sold are ", drinks_category, sandwiches_category, cakes_category)
4 Open the file ITEMCATEGORIES.py Save the file as MYCATEGORIES_<your name>_<centre number>_<index number> 7 Edit your program so that it: (a) Accepts the item codes for 20 items. [1] (b) Prints out the category name with the highest number of items sold and also its number of items sold. You may assume that there is only 1 category with the highest number of items sold. [4] (c) Includes validations to test whether the item code entered is valid, and if not, asks the user for input again as necessary. [3] Save your program. 8 Save your program as VARCATEGORIES_<your name>_<centre number>_<index number> Edit your program so that it works for any number of items. [2] Save your program. Task 3 Check digit is used in the International Standard Book Number. An example is the ISBN 13, where the 13th digit of the ISBN code is calculated using the following algorithm. Step 1 : Add all the odd numbered digits together, excluding the check digit, and multiply the result by the weight, 1. Step 2 : Add all the even numbered digits together and multiply the result by the weight, 3. Step 3 : Add the results from Step 1 and Step 2 together and divide by 10. Step 4 : Take the remainder, if it is zero use this value as the check digit. Otherwise subtract the remainder from 10 to find the check digit. For example, a valid ISBN 13 is 9789814176712 and an invalid ISBN 13 is 9789814176703. The following program should check whether an ISBN number is valid by deriving its resulting check digit from the first 12 digits. There are several syntax errors or logical errors in the program.
5 multiplier_weight = 1 total = 13 isbn = input ("Enter an ISBN-13 number with no spaces ") check_digit = int(isbn[13]) for i in range(11): total = total + isbn * multiplier_weight if multiplier_weight == 1: multiplier_weight = 0 else: multiplier_weight = 1 remainder = total % 11 result = remainder - 11 if result == remainder: print ("ISBN Number is valid") else: print ("ISBN Number is invalid") Open the file ISBNCHECKDIGIT.py Save the file as MYISBNCHECKDIGIT_<your name>_<centre number>_<index number> 9 Identify and correct the errors in the program so that it works correctly according to the algorithm above. [10] Save your program.
6 Task 4 A company employs salesmen to sell cars. The company operates on a 5-days week from Monday to Friday. You have been asked to write a program to calculate the average number of cars sold per week by four salesmen. Each salesman may sell any number of cars in a day. The program should allow you to: • Enter data in the format a, b, c, d, e where a, b, c, d, e are the number of cars sold by a salesman over the 5 days. An example is 2, 0, 3, 1, 1 where a Salesman sells 2 cars on Day 1 (Monday), 0 car on Day 2 (Tuesday), 3 cars on Day 3 (Wednesday), 1 car on Day 4 (Thursday) and 1 car on Day 5 (Friday). • Only allow data entry of 0 or more cars. • Calculate the total number of cars sold by each salesman. • Repeat this for a total of 4 salesmen. • Find the average number of cars sold by a salesman in the 5-days week rou
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

