A 1D array, Product, of type STRING is used to store information about a range of products
Question:
A 1D array, Product, of type STRING is used to store information about a range of products in a shop. There are 100 elements in the array. Each element stores one data item.
The format of each data item is as follows:
– ProductID is a four-character string of numerals
– ProductName is a variable-length string
The following pseudocode is an initial attempt at defining a procedure, ArraySort, which will perform a bubble sort on Product. The array is to be sorted in ascending order of ProductID. Line numbers have been added for identification purposes only.
The pseudocode contains a number of errors.
Copy and complete the following table to show:
– The line number of the error
– The error itself
– The correction that is required. [8]
Note:
– If the same error occurs on more than one line, you should only refer to it ONCE.
– Lack of optimisation should not be regarded as an error.
Step by Step Answer:
Cambridge International AS & A Level Computer Science
ISBN: 9781510457591
1st Edition
Authors: David Watson, Helen Williams