Answer:
(a) In line 3, 2 should be changed to 1
Explanation:
Given
The attached procedure to return true if numberList is in ascending order
Required
Which line(s) need to be changed
On line 3 of the program, we have:;
![count \to 2](https://tex.z-dn.net/?f=count%20%5Cto%202)
On line 6, we have the following comparison:
![numberList[count]](https://tex.z-dn.net/?f=numberList%5Bcount%5D%20%3CnumberList%5Bcount-1%5D)
Substitute 2 for count
![numberList[2]](https://tex.z-dn.net/?f=numberList%5B2%5D%20%3CnumberList%5B2-1%5D)
![numberList[2]](https://tex.z-dn.net/?f=numberList%5B2%5D%20%3CnumberList%5B1%5D)
The above implies that, the first comparison made by the program is to compare numberList elements at index 2 and index 1.
This means that, the first element (i.e. index 0) has been ommitted in the program.
<em>Hence, for the program to work as intended, 2 should be changed to 1 on line 3</em>