Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write the output that is printed when the given method below is passed each of t

ID: 3855317 • Letter: W

Question

Write the output that is printed when the given method below is passed each of the following maps as its parameter. Assume that each parameter map stores its key/value pairs in exactly the order shown, and that is the order in which a for-each loop would examine them. Recall that maps print in a {key1=value1, key2=value2, ..., keyN=valueN} format. Your answer should display the right values in the right order.

{sheep=wool, house=brick, cast=plaster, wool=wool} {munchkin=blue, winkie=yellow, corn=yellow, grass=green, emerald=green} {pumpkin=peach, corn=apple, apple=apple, pie=fruit, peach=peach} {lab=ipl, lion=cat, terrier=dog, cat=cat, platypus=animal, nyan=cat}

Explanation / Answer

sheep=wool, house=brick, cast=plaster, wool=wool}

OUTPUT : [brick, plaster]

{munchkin=blue, winkie=yellow, corn=yellow, grass=green, emerald=green}

OUTPUT : [blue, green, yellow]

{pumpkin=peach, corn=apple, apple=apple, pie=fruit, peach=peach}

OUTPUT : [apple, fruit]

{lab=ipl, lion=cat, terrier=dog, cat=cat, platypus=animal, nyan=cat}

OUTPUT : [animal, cat, dog, ipl]