Customers collect points every time they make a purchase at a store. A program is used to manage the points system and the table lists some of the information stored for one customer. Information Data type required Name String Number of points collected Integer Date of birth Date
- (a)(i)Identify a suitable structure for storing the information for one customer. Explain the advantage of using this structure. Structure Advantage[4]
- (a)(ii)Describe a data structure that could be used to store the information for all customers.[2]
- (b)Customers receive points depending on the amount they spend. The number of points depends on the band that the amount falls into: Band Amount Points 1 Less than 10 5 per whole dollar () 2 Between $10 and $100 inclusive 7 per whole dollar ($) 3 Over $100 10 per whole dollar ($) For example, if the amount is $99.77, this amount is in band 2 and therefore the number of points is 7 x 99, which is 693 points. The algorithm to calculate the points from a given amount is expressed as follows: • work out the appropriate band • calculate and output the number of points. Apply the process of stepwise refinement to increase the detail of the algorithm. Structure your algorithm into a sequence of five steps that could be used to produce pseudocode. Write the five steps. 1 2 3 4 5[5]
Mark scheme
Marking points from the official mark scheme (May/June 2023). The mark or mark type is shown in brackets.
- [4] One mark for structure Structure: Record One mark for each point Advantage: • A set of data / all data related to one customer • of different types • is held under a single identifier/entity
- [2] A (1D) array of records // An array of the given type could be used One mark per underlined word
- [5] One mark for reference to each: 1 Reference to the use of constants or variables for the two threshold values of 10 and 100 // Input amount spent (by customer and store in a numeric variable) 2 Work out one band that amount maps to 3 Work out all bands that amount maps to 4 Calculate rounded value of amount / whole number part of amount 5 Calculate the points by multiplying the (rounded) amount by the appropriate value for appropriate band /all bands 6 Output the number of points Note: Max 5 from available points
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 →