You are on page 1of 2

Begin

Declare
Declare
Declare
Declare
Declare
Declare
Declare

SArray[40],search As string
ID[40] As real
i,b,maximum as real
choice,answer As char
swap As string
Chart[5][6], As string
found As boolean

Driver()
For i=1 to 40
print seat[i]
Print "enter student identification please"
Read ID [i]
Info()
print"enter d for descending or a for ascending"
read choice
if choice=b then
Decending()
if choice=a then
Acending()
seated()
print "Would you like to search for a student press y for yes and n for no"
read answer
if answer=y then
find()
if answer=n then
print "have a good day"
endif
end
Function Info()
For i=1 to 40 do
Print "Enter name of student Please"
Read SArray[i]
Endfor
End Info

Function decending()
for i=0 To 39 Do
for b=1 To (39-i) DO
if SArray[b]<SArray[b+1] Then
swap=SArray[b+1]
SArray[i]=SArray[b+1]
swap=SArray[i]
swap=id_num[b+1]
ID[b]=ID[b+1]
swap=ID[i]
endif
endfor
endfor
End Descending
Function acending()
for i=0 To 39 Do

for b=1 To (39-i) DO


if SArray[b]>SArray[b+1] Then
swap=SArray[b+1]
SArray[i]=SArray[b+1]
swap=SArray[i]
swap=id_num[b+1]
ID[b]=ID[b+1]
swap=ID[i]
endif
endfor
endfor
End Descending
Function Seated()
Max <-- 40
For b = 1 to 6 do
For i = 1 to 5 do
SeatingChart[b][i] <-- SArray[Maximum]
Max <-- Max - 1
EndFor
Endfor
For b = 1 to 6 do
Print "Row Number", d
For i = 1 to 5 do
Print Chart[b][i]
EndFor
Endfor
End Seated
function find()
Print "Enter ID number of a student "
Read search
found <- false
For b=1 to 6 do
For i=1 to 5 do
If (SeatArrangement[b][i] = search) Then
Found <- true
row <- b
column <- i
Endif
Endfor
Endfor
If (found = true) Then
Print "Student has been found in row", row, "and column", column
Else
Print "Student could not been."
End find

You might also like