SST 2019 Prelim P2
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Text from the first pagesSECONDARY 4 PRELIM EXAMINATION COMPUTING Paper 2 Practical (Lab-based) 7155/02 27 August 2019 (Tuesday) 2 hour 30 minutes CANDIDATE NAME CLASS INDEX NUMBER Additional Materials: Electronic version of BANK.XLSX data file Electronic version of SHOPPING.PY file Electronic version of NUMBERS.PY file Insert Quick Reference Glossary READ THESE INSTRUCTIONS FIRST 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 7 printed pages.
Page 2 of 7 Task 1 The Bank of Singapore (BOS) uses a spreadsheet software to record the money deposited and how many months the money will be in the bank. You are required to finish setting up the spreadsheet to record the interest that will be paid. For consistency, you are also required to display all results as positive numbers. Open the file BANK.xlsx. You will see the following data. Save your file as BANK_<your name>_<index number>. (a) In cell C23, enter a formula to calculate the standard deviation of the amount deposited. [1] (b) In cell C24, enter a formula to count how many deposits are more than $3000. [1] (c) 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] (d) Enter a formula to calculate the simple interest payable for account holders and use it to complete the Interest Payable. [2]
Page 3 of 7 [Turn over (e) Use a conditional statement to identify those savers who have deposited more than $3000 over 24 months and put YES in the Gift Voucher column. Otherwise put NO in the Gift Voucher Column. [2] (f) The bank manager wants to do some scenario planning, where each account holder deposits his/her money for 48 months with a compounded interest rate of 2.00% per annum. The amount of money in the account after 48 months is then recorded in the What-If column. Complete the column for all the bank accounts. [2] Save and close your file.
Page 4 of 7 Task 2 The following program simulates a shopping cart. It accepts 3 different items and the quantity of each item, and places them in a list. After processing, it prints out the item with the largest quantity, as well as its respective quantity. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 #input items in a shopping cart and the quantity different_items = 3 shopping_cart = [] shopping_item = [] for i in range(different_items): new_item = input("Please enter an item: ") new_quantity = input("Please enter the quantity of item: ") shopping_item = [new_item, int(new_quantity)] shopping_cart.append(shopping_item) print(shopping_cart) largest_quantity = 0 sequence = 0 for j in range(different_items): if shopping_cart[j][1] > largest_quantity: sequence = j largest_quantity = shopping_cart[j][1] print("The item with the greatest quantity is ",shopping_cart[sequence][0]) print("There are ",largest_quantity, shopping_cart[sequence][0], "in total.") Open the file SHOPPING.py Save the file as SHOPPING _<your name>_<index number> Edit the program so that it: (a) Allows the input of five different items and their respective quantities. [1] (b) Ensures that the quantities input by the user are positive integers. Otherwise, the program should inform the user about the input requirements and ask for re-entry of the input. [3] (c) Also displays the item name with the smallest quantity, followed by its quantity separated by a space. [3] (d) Allows user to input the unit cost of each item. All items are priced in dollars. [1] (e) Calculates and displays the total cost of all the items in the shopping cart. [2]
Page 5 of 7 [Turn over Task 3 Donald is fascinated with the number 1089 and he has recently learnt about a formula that will end up with the number 1089 as long as the input requirements are met. The requirements are as follows: 1. A three-digit number is input. 2. The first and third digits of the number cannot be the same, e.g. 121 is not allowed. The formula to produce 1089 is as follows: 1. Let A be the input number. 2. Let B be the number where first and third digits of A are swapped. 3. Let X = | A – B | (absolute value of A – B). 4. Let Y = the number where first and third digits of X are swapped. 5. Let Result = X + Y. Open the file NUMBERS.py Save the file as NUMBERS_<your name>_<index number>.py Write a program to help Donald test out this formula. Your program must be able to do the following: • Get the required number from user with appropriate prompt. • Verify the input. If the verification fails, display an appropriate error message and ask the user to re-enter the number. • Display the subtraction step in a single line. E.g. "721 – 127 = 594". • Display the addition step in a single line. E.g. "594 + 495 = 1089". • Ask the user if he wants to try again. Repeat step 1 if user agrees; otherwise end the program. Save your program. [10]
Page 6 of 7 Task 4 Zelda is studying in Hyrule Secondary School (HSS). In HSS, the overall percentage for each subject is calculated using this formula: 40% of Sem1 + 60% of Sem2 = Overall (100%) Where Sem1 = 30% of CA1 + 70% of SA1 Sem2 = 30% of CA2 + 70% of SA2 0 ≤ marks ≤ 100 This is Zelda's streaming year. In order to get into the class with the subject combination of her choice, Zelda needs to ensure she obtains a certain overall percentage for each of her subjects. Zelda knows her marks for CA1, SA1 and CA2 of Subject A. (a) Write a program to help Zelda find out how many marks she needs to score in SA2 to obtain a desired overall percentage for Subject A. Your program needs to do the following: ○ Ask Zelda to input the marks CA1, SA1 and CA2 respectively in a single line. You may modify and use the following code: ca1, sa1, ca2 = input().split() ○ Verify the input. When verification fails, an appropriate message must be displayed. Your program should then ask Zelda to enter the marks again. ○ Calculate the required marks Zelda needs to obtain for her SA2 in order to achieve the following overall grades. Overall Grade Overall Percentage A1 75 to 100 A2 70 to 74 B3 65 to 69 B4 60 to 64 ○ Display all four desired overall grades and the required SA2 in the following format "Grade : Required Mark(rounded to one decimal place)" If required mark is not obtainable, display "Not obtainable" instead. For example: A1 : 77.4 … B4 : 61.9
Page 7 of 7 [Turn over Save your file as TESTQ4a_<your name>_<index number>.py [10] (b) Run your program with the following inputs 1. 65 101 80 2. 65 81 a 3. 75 40 70 Take a screenshot of the program display and save it as TESTQ4b_<your name>_<index number>.jpg [3] (c) Zelda wants to know if she needs more consultation time with her subject teacher. She comes u
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

