/* 1999-2003, Rony G. Flatscher, Wirtschaftsuniversitaet Wien, Austria, Europe
   A *possible* solution to excercise: 9+10+11 (1)
*/


Fruit_Bag = .bag~of( "Apfel", "Apfel", "Birne", "Erdbeere", "Apfel", "Banane",        ,
                     "Zwetschke", "Zwetschke", "Banane", "Apfel", "Birne", "Papaya",  ,
                     "Erdnuss", "Erdnuss", "Erdnuss", "Erdnuss", "Erdnuss", "Apfel",  ,
                     "Erdnuss", "Ananas", "Banane", "Zwetschke", "Birne", "Birne",    ,
                     "Zwetschke", "Zwetschke", "Banane", "Apfel", "Birne", "Papaya",  ,
                     "Erdnuss", "Erdnuss", "Erdnuss", "Apfel", "Erdnuss", "Ananas",   ,
                     "Banane", "Erdnuss", "Erdnuss", "Erdnuss", "Erdnuss", "Erdnuss", ,
                     "Apfel", "Erdnuss", "Ananas", "Banane", "Erdnuss", "Papaya",     ,
                     "Mango", "Erdnuss", "Erdnuss", "Apfel", "Erdnuss", "Ananas",     ,
                     "Banane", "Birne" )

SAY "Total of fruits in bag:" Fruit_Bag~items
SAY

Fruit_Set = .set~new~union(Fruit_Bag)
SAY "consisting of:"
DO fruit OVER Fruit_Set
   SAY RIGHT(fruit, 21) || ":" RIGHT( Fruit_Bag~allat(fruit)~items, 3 )
END