2021 TSS Computing P2
Uploaded by IDKWHYBUTIAM · 3 November 2024
Preview
Task 1 A student is collating orders for her class for lunch during Teacher’s Day celebration: Each student has ordered at least 2 items and up to 3 items from the menu. Each menu item has a unique ID code. For mains, the ID begins with an ‘M’. For sides, the ID begins with an ‘S”. For drinks and dessert, the ID begins with a ‘D’. You are required to finish setting up the spreadsheet to tabulate the orders and total cost. Open the file TASK1.xlsx. You will see the following data. Save the file as TASK1_<your name>_<class>_<index number>.xlsx For the following questions, where appropriate , all currency values should be shown in 2 decimal places, e.g. $1.00. 1 In cell s D4 to D28 , use an appropriate function to determine the corresponding prices of each order item in cells C4 to C28 from the ‘Summary’ table on the right. Likewise, complete cells F4 to F28 with prices of order items in cells E4 to E28. [2] 2 In cells H4 to H28, use an appropriate formula to determine the corresponding prices of each order item in cells G4 to G28 from the ‘Summary’ table on the right. If the student has not ordered a third item, then the price should be shown as $0.00. [1] 3 If a student has ordered a main, a side and a drink or dessert, then it is considered a set meal and the student will be entitled to a 10% discount.
2 In cells I4 to I28, use an appropriate function to determine the discount amount each student is entitled to, in dollars. [2] 4 In cells J4 to J28, use an appropriate formula to determine the total cost that each student needs to pay for their lunch, taking into consideration the discount that they are each entitled to. [1] 5 In cell s O4 to O30 , use an appropriate function to determine the total quantity ordered by the class for each menu item. [2] 6 In cell J30, use an appropriate function to determine the average payment to be made by each student. [1] 7 In cells J4 to J28, apply conditional formatting to underline the values that are equal to or greater than 120% of the average value found in Question 6. [1]
3 Task 2 The following program helps the user to solve a quadratic equation, ax2 + bx + c = 0, where the values for a, b and c are integers input by the user. a = int(input("Enter value of 'a': ")) b = int(input("Enter value of 'b': ")) c = int(input("Enter value of 'c': ")) sol1 = (-b+(b**2-4*a*c)**0.5)/(2*a) sol2 = (-b-(b**2-4*a*c)**0.5)/(2*a) print(sol1, sol2) Open the file TASK2.py Save the file as TASK2_Q8_<your name>_<class>_<index number>.py 8 Edit the program so that it: (a) Outputs the statement "The solutions to this quadratic equation are X and Y." at the end of the program, where X and Y represents the value of the two solutions. [1] (b) Checks whether the two solutions are the sam
Content continues in the PDF.
Related notes
- 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

