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 stringThe following pseudocode is an initial attempt at

Chapter 12, End Of Chapter Questions #2

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.

This problem has been solved!


Do you need an answer to a question different from the above? Ask your question!
Related Book For answer-question

Cambridge International AS & A Level Computer Science

1st Edition

Authors: David Watson, Helen Williams

ISBN: 9781510457591