Solved

# Procedure problem

Posted on 1997-11-20

How do i write a procedure which takes an array of ten integer account codes and sorts them into ascending order. The only info i have been givenis:-

TYPE numbers=array[1..10] of integer

Var accounts : numbers

i = a var used to index the array

j = a var used to index the array

figures = an array used to hold integers to be sorted

temp = used as a temporary store when elements of the array

are to be interchanged

lowest = this holds the index of the current of the current

lowest element of the array,figures

Top down

for ten times

initialize variables

for the unsorted accounts

if this account<lowest in unsorted part

then

set index of lowest to index of this account

end if

end for

set temp var to lowest account number

set lowest to value of first in unsorted part

set first in unsorted part to value of temp var

end for

I know that you will probably find this incredably easy but it is the first procedure i have come up against as i have only been doing this for a month.

any help you can give me will be much appreciated.