Question 2
Edexcel Computer Science June 2019 Paper 2GCSE8 marks
On the specification
- (a)
- 6.2 Program constructs
- (b)
- 6.3 Data types and structures
- (c)(i)
- 6.2 Program constructs
- (c)(ii)
- 3.2 Software
Question text
2 When stocks of items sold in the kiosk are low, they are reordered from the supplier. Any items that have passed their sell-by date are disposed of. (a) A computer program can be used to determine when to dispose of or reorder cookies. Complete the table to show an input, a process and an output, using the following information: • each pack of cookies has a sell-by date • there must always be at least 10 packs of each type of cookie in stock • quantity ordered must bring the number of packs of each type up to 10. (3) Input Process Output Determine if the sell-by date Yes, dispose of pack of cookies is passed No, keep pack of cookies Number of packs of this type of Determine if number of packs cookie < 10 Number of packs of this type of Reorder this number of packs cookie to reorder of this type of cookie (b) Data about each item is encoded into text and is stored by a computer program as data type STRING. The format is the same for every item (DD MMM YYYY). The data for chocolate chip cookie is shown. L6041 8653 14 NOV 2019 L1017 Indexing is used to reference each location in the string. State the indexing expression for the first character and the last character of the sell-by date. (3) First character Last character (c) The pseudocode for an infinite loop is shown. (i) Identify the pseudocode that makes this an infinite loop. (1) (ii) State how the user would stop this code running when it is executing on a computer. (1) (Total for Question 2 = 8 marks)