An online computer shop sells customised personal computers. Every computer sold includes a basic set of components costing 200 and additional items can be added from the table: Category | Item code | Description | Price () --- | --- | --- | --- Case | A1 | Compact | 75.00 Case | A2 | Tower | 150.00 RAM | B1 | 8 GB | 79.99 RAM | B2 | 16 GB | 149.99 RAM | B3 | 32 GB | 299.99 Main Hard Disk Drive | C1 | 1 TB HDD | 49.99 Main Hard Disk Drive | C2 | 2TB HDD | 89.99 Main Hard Disk Drive | C3 | 4TB HDD | 129.99 Solid State Drive | D1 | 240 GB SSD | 59.99 Solid State Drive | D2 | 480 GB SSD | 119.99 Second Hard Disk Drive | E1 | 1 TB HDD | 49.99 Second Hard Disk Drive | E2 | 2TB HDD | 89.99 Second Hard Disk Drive | E3 | 4TB HDD | 129.99 Optical Drive | F1 | DVD/Blu-Ray Player | 50.00 Optical Drive | F2 | DVD/Blu-Ray Re-writer | 100.00 Operating System | G1 | Standard Version | 100.00 Operating System | G2 | Professional Version | 175.00 As well as the basic set of components every computer must include one case, one RAM and one Main Hard Disk Drive from the table. A computer is supplied with or without an Operating System. Write and test a program or programs for the online computer 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 and ordering the main items. Write a program to: • use arrays to store the item code, description and price • allow a customer to choose one case, one RAM and one Main Hard Disk Drive • calculate the price of the computer using the cost of the chosen items and the basic set of components • store and output the chosen items and the price of the computer. Task 2 – Ordering additional items. Extend TASK 1 to: • allow a customer to choose whether to purchase any items from the other categories – if so, which item(s) • update the price of the computer • store and output the additional items and the new price of the computer. Task 3 – Offering discounts. Extend TASK 2 to: • apply a 5% discount to the price of the computer if the customer has bought only one additional item • apply a 10% discount to the price of the computer if the customer has bought two or more additional items • output the amount of money saved and the new price of the computer after the discount. All variables, constants and other identifiers must have meaningful names.
- (a)(i)Identify one array you could have used for Task 1 and state its purpose.[2]
- (a)(ii)Identify one variable you could have used for Task 2 and state its purpose.[2]
- (a)(iii)Identify one constant you could have used for Task 3 and state its purpose.[2]
- (b)Explain the benefits of storing Price as a real data type.[2]
- (c)Write an algorithm to show how you completed Task 1, using either pseudocode, programming statements or a flowchart. It is not necessary to show initialisation or setting up of arrays in your answer.[6]
- (d)Explain how your program completes Task 3. Any programming statements used in your answer must be fully explained.[4]
- (e)Describe how you could alter your program to allow more than one computer to be bought.[2]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2020). The mark or mark type is shown in brackets.
- [2] Any meaningful name for an array related to Task 1 one mark e.g. SysStore SysPrice
- Correct purpose related to Task 1 one mark e.g. ...to store the system (components) that have been purchased ...to store the (total) price of the system (being purchased)
- [2] Any meaningful name for a variable related to Task 2 one mark e.g. Component TotalPrice
- Correct purpose related to Task 2 - one mark e.g. to allow input of a component code to store/calculate the running total price of the system
- [2] Any meaningful name for a constant related to Task 3 one mark e.g. Offer5 Offer10
- Correct purpose related to Task 3 - one mark e.g. to store the one option discount rate to store the two-option discount rate
- [2] Mark as either: Two distinct different points OR One point and an expansion
- Example answers: Real data can be used in calculations directly (which is required of the Price data) (1) Data can be stored with decimal places (1)
- Real numbers can be used in calculations (1) which is not possible with strings (1)
- [6] Any six from: MP1 At least one input (case, RAM, HDD)
- MP2 All three inputs fully prompted
- MP3 An attempt at validation of input
- MP4 One complete validation of input with error message
- MP5 Finding the price for one chosen item
- MP6 Finding the prices of the other two chosen items correctly
- MP7 Calculation of price of the chosen items
- MP8 ...add the basic components cost to the cost of the chosen items
- MP9 Storage of chosen items
- MP10 Output to show chosen items and price of the computer (with appropriate message)
- [4] Any four from: MP1 Explanation of how the number of additional parts is stored
- MP2 Explanation of counting of additional parts being added to the system
- MP3 Explanation of determination of additional parts being 1, or more than 1
- MP4 Explanation of using the correct percentage discount
- MP5 Explanation of calculating the money saved and finding the new price
- MP6 Explanation of correct output of money saved and new price
- [2] Any two from: MP1 Prompt and input to ask buyer how many computers they wish to purchase (at the start) // When the first computer is complete, prompt and input to ask if they would like to purchase another computer
- MP2 Introduce an appropriate loop structure
- MP3 New storage for more than one computer // Enable the ordering of multiple computers of the same specification
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 →