SST 2019 Prelim P2 Solution
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Text from the first pages1 2019 SEC 4 COMPUTING PRELIM PAPER 2 MARKING SCHEME Task 1 Question Answer Marks (a) =STDEV(B2:B21) 1 (b) =COUNTIF(B2:B21, “>3000”) 1 (c) =VLOOKUP(C2,$E$27:$G$31,3,TRUE) 2 (d) = B2 * C2 * D2 / 12 2 (e) =IF(AND(B2>3000,C2>24),"YES","NO") 2 (f) =FV(2%/12,48,0,-B2) 2
2 Task 2 Question Answer Marks # Input items in a shopping cart and the quantity # Change of different_items to be 5. different_items = 5 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: ") # Check that new quantity is positive integer. # A prompt for user of quantity is not integer # Allow user to re-enter the input while not new_quantity.isdigit() or int(new_quantity) <= 0: print("The quantity needs to be positive integer.") new_quantity = input("Please enter the quantity of item: ") # Allow user to input unit cost of item new_cost = input("Please enter the unit cost of item: ") shopping_item = [new_item, int(new_quantity), float(new_cost)] 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] # Initialising smallest_quantity # Determine the item with the smallest quality smallest_quantity = shopping_cart[0][1] sequence2 = 0 for k in range(different_items): if shopping_cart[k][1] < smallest_quantity: sequence2 = k
3 smallest_quantity = shopping_cart[k][1] print("The item with the greatest quantity is ",shopping_cart[sequence][0]) print("There are ",largest_quantity, shopping_cart[sequence][0], "in total.") # Print the item with the smallest quantity and the respective quantity. print("The item with the smallest quantity is ",shopping_cart[sequence2][0]) print("There are ",smallest_quantity, shopping_cart[sequence2][0], "in total.") # Multiply cost of each item with quantity # Add the total cost of items cost = 0 for p in range(different_items): cost += shopping_cart[p][1] * shopping_cart[p][2] print("The total cost is $",cost)
4 Task 3 Question Answer Marks Get the required number from user with appropriate prompt Verify the input, if the verification fails, display 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 wants to, otherwise end the program.
5 Task 4 Question Answer Marks (a) Get user to enter the 3 input in a single line Verify all 3 input as int and with 0-100 range Apply the correct formula to calculate marks required for SA 2 to obtained A1, A2, B3, B4 grade Display the results (b) 1st input should ask user to re-enter marks 2nd input should ask user to re-enter marks 3rd input should display result with A1 being "Not Obtainable" (c) Able to modify the algorithm for "more time" Able to display "more time" Able to modify the algorithm for "maintain" Able to display "maintain" Able to modify the algorithm for "Can divert" Able to display "Can divert" (d) Suggested result for image (to be updated later when input are decided)
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

