A shop sells car accessories. A customer order is created if an item cannot be supplied from current stock. A program is being developed to create and manage the customer orders.
- (a)The following identifier table shows some of the data that will be stored for each order. Complete the identifier table by adding meaningful variable names and appropriate data types. Example value Explanation Variable name Data type "Mr Khan" The name of the customer 3 The number of items in the order TRUE To indicate whether this is a new customer 15.75 The deposit paid by the customer[4]
- (b)Other variables in the program have example values as shown: Variable Example value Total 124.00 DepRate 2.00 Description "AB12345:Cleaning Brush (small) " Complete the table by evaluating each expression using the example values. Expression Evaluates to (Total * DepRate) + 1.5 RIGHT(Description, 7) (LENGTH(Description) - 8) > 16 NUM_TO_STR(INT(DepRate * 10)) & '%'[4]
- (c)The data that needs to be stored for each customer order in part (a) is not all of the same type. Describe an effective way of storing this data for many customer orders while the program is running.[3]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2023). The mark or mark type is shown in brackets.
- [4] One mark for each row with appropriate variable name and data type
- Example value: "Mr Khan", Explanation: The name of the customer, Variable name: CustomerName, Data type: STRING
- Example value: 3, Explanation: The number of items in the order, Variable name: NumItems, Data type: INTEGER
- Example value: TRUE, Explanation: A value to indicate whether this is a new customer, Variable name: NewCustomer, Data type: BOOLEAN
- Example value: 15.75, Explanation: The deposit paid by the customer, Variable name: Deposit, Data type: REAL
- [4] One mark per row
- Expression: (Total * DepRate) + 1.5, Evaluates to: 249.50
- Expression: RIGHT(Description, 7), Evaluates to: "(small)"
- Expression: (LENGTH(Description) - 8) > 16, Evaluates to: TRUE
- Expression: NUM_TO_STR(INT(DepRate * 10)) & '%', Evaluates to: "20%"
- [3] One mark per point Max 3 marks
- Declaration
- 1 Declare a composite / record (type)
- 2 Declare an array of the given composite / record (type)
- Expansion of record:
- 3 containing all data items required // containing items of different data types
- Expansion of array:
- 4 where each array element represents data for one order / customer (order)
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 →