Skip to main content
O-LevelComputer ScienceProgramming2210/21 · May/June 2020 · Q120 Marks

All variables, constants and other identifiers must have meaningful names. Section A You are advised to spend no longer than 40 minutes answering this section. Here is a copy of the pre-release material. DO NOT attempt Tasks 1, 2 and 3 now. Use the pre-release material and your experience from attempting the tasks before the examination to answer Question 1. Pre-release material A shop sells a range of mobile devices, SIM cards and accessories as shown in the table: Category | Item code | Description | Price ($) ---------|-----------|-------------------------------------------------|----------- Phone | BPCM | Compact | 29.99 Phone | BPSH | Clam Shell | 49.99 Phone | RPSS | RoboPhone - 5-inch screen and 64 GB memory | 199.99 Phone | RPLL | RoboPhone - 6-inch screen and 256 GB memory | 499.99 Phone | YPLS | Y-Phone Standard - 6-inch screen and 64 GB memory | 549.99 Phone | YPLL | Y-Phone Deluxe - 6-inch screen and 256 GB memory | 649.99 Tablet | RTMS | RoboTab - 8-inch screen and 64 GB memory | 149.99 Tablet | RTLM | RoboTab - 10-inch screen and 128GB memory | 299.99 Tablet | YTLM | Y-Tab Standard - 10-inch screen and 128 GB memory | 499.99 Tablet | YTLL | Y-Tab Deluxe - 10-inch screen and 256 GB memory | 599.99 SIM card | SMNO | SIM Free (no SIM card purchased) | 0.00 SIM card | SMPG | Pay As You Go (SIM card purchased) | 9.99 Case | CSST | Standard | 0.00 Case | CSLX | Luxury | 50.00 Charger | CGCR | Car | 19.99 Charger | CGHM | Home | 15.99 Write and test a program or programs for this shop. • Your program or programs must include appropriate prompts for the entry of data; data must be validated on entry. • Error messages and other output need to be set out clearly and understandably. • All arrays, variables, constants and other identifiers must have meaningful names. You will need to complete these three tasks. Each task must be fully tested. Task 1 - Setting up the system. Write a program to: • use appropriate data structures to store the item code, description and price information for the mobile devices, SIM cards and accessories • allow the customer to choose a specific phone or tablet • allow phone customers to choose whether the phone will be SIM Free or Pay As You Go • allow the customer to choose a standard or luxury case • allow the customer to choose the chargers required (none, one or both may be purchased) • calculate the total price of this transaction • output a list of the items purchased and the total price. Task 2 - Allow a customer to order multiple mobile devices. Extend Task 1 to: • offer the customer the opportunity to purchase an additional mobile device • if required, perform bulleted steps 2 to 7 of Task 1 for each additional mobile device and calculate a running total for the customer • once no further devices are required, output the total the customer will need to pay. Task 3 - Offering discounts. Extend the program to allow a discount of 10% off the price of every additional phone or tablet purchased. Output the new total the customer will need to pay and the amount of money saved.

  1. (a)(i)Identify two arrays you could have used for Task 1 and, in each case, state its purpose.[4]
  2. (a)(ii)Identify two variables you could have used for Task 1 and, in each case, state its purpose.[4]
  3. (b)Explain why the item code data could not be stored as a real data type and identify the most suitable data type for the item code data.[2]
  4. (c)Write an algorithm to show how you input your choice of mobile device and SIM card (part of Task 1), using either pseudocode, programming statements or a flowchart. It is not necessary to show initialisation or setting up of arrays containing product details.[5]
  5. (d)Explain how your program completes Task 3. Any programming statements used in your answer must be fully explained.[5]

Mark scheme

Marking points from the official mark scheme (May/June 2020). The mark or mark type is shown in brackets.

  1. [4] Any meaningful array related to Task 1 one mark (max two) e.g. ItemCode, Description
  2. Correct purpose for each array related to Task 1 one mark (max two) e.g. ...to store the item codes, ...to store the descriptions of the items for sale
  3. [4] Any meaningful variable related to Task 1 one mark (max two) e.g. PurchaseItem, TotalPrice
  4. Correct purpose for each variable related to Task 1 one mark (max two) e.g. to allow input of an item/code for purchase, to store/calculate the total price of the transaction
  5. [2] Any one correct statement e.g. The Code data is made up of letters/alphabetic characters/not numbers, Real data must have numerical value/would not be used in calculations
  6. One mark for: String
  7. [5] Any five from: Input with message to allow choice of mobile device, Attempt to validate input to check for valid item code, Accurate validation of input to check for valid item code, Determination of whether device is phone or tablet, Restriction to only allow input for SIM card required if mobile device is a phone, Input with message to find out if a SIM card is required
  8. Example answer OUTPUT "Which type of phone or tablet would you like? Input the Item Code" DeviceFlag ← False WHILE DeviceFlag = False INPUT DeviceCode Count ← 0 WHILE Count<10 DO IF DeviceCode = ItemCode [Count] THEN IF Count < 6 THEN DeviceType ← "Phone" ELSE DeviceType ← "Tablet" ENDIF DeviceFlag ← True Count ← 10 ENDIF Count← Count + 1 ENDWHILE IF DeviceFlag = False THEN OUTPUT "Your code doesn't exist, please try again" ENDIF ENDWHILE IF DeviceType = "Phone" THEN OUTPUT "Would you like a SIM Card? (Answer Y or N)" INPUT SimRequired ENDIF
  9. [5] Any five from: Explanation of finding if more than one device is purchased, Explanation of application of device discount, Explanation of calculating the discount(s) and finding the new price, Explanation of outputting new total, Explanation of outputting amount saved, Explanation of messages used

Write your answer and get it marked

On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.

Sign up free →

About this question

Topic
Programming, O-Level Computer Science (syllabus 2210). Structured question, 20 marks.
Source
O-Level Computer Science, May/June 2020 Paper 2 Variant 1, question 1.

Questions and mark schemes are from past examination papers and remain the copyright of the exam board. How Oracle Prep builds its content

Related Computer Science questions

© 2026 Oracle Prep