Computer Science Canada

hey guys sorry to bug every1 but i need help

Author:  baby girl [ Sun Dec 01, 2002 11:44 am ]
Post subject:  hey guys sorry to bug every1 but i need help

Write a program to read a series of first names of ppl .after reading the series (you will need a signal), output the name that is alphabetically last ???whats the code for that and the flowchart too??


that program i dont get can any1 help me out

Author:  Tony [ Sun Dec 01, 2002 2:12 pm ]
Post subject: 

well you'll get an input of amount of names to be entered
code:
get namesNum

then run a code inputing names into array
code:
for i:1..namesNum
get name(i)
end for


then use bubble sort to find "biggest" name alphabetically

code:
for i:1..namesNum -1
if name(i) > name(i+1)
then
name(i+1) = name(i)
end if
end for


At the end, name(namesNum) will be alphabetically last in the list. Though this code with screw up the array. If you need names for further use, you store the name in another variable


: