December 22, 2024

Answer to Collections Q8

 

(i)
disasterPlanes := SortedCollection new.
airDisasters keysAndValuesDo: [ :plane :when |
   disasterPlanes add: plane ].
(ii)
planesString := 'List of disaster planes in alphabetic order:'.
disasterPlanes do: [ :plane |
    planesString := planesString, '\', plane ].
Dialog warn: planesString withCRs.

 

Back to « Collection Questions 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Up to top of page