{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


34-section-handout-6 - GImage as shown on the right 2 Name...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Mehran Sahami Handout #34 CS 106A November 5, 2007 Section Handout #6: More Arrays and HashMaps Portions of this handout by Eric Roberts 1. Image processing (Chapter 11, exercise 12, page 458) Write a method flipHorizontal that works similarly to the flipVertical method presented in the chapter except that it reverses the picture in the horizontal dimension. Thus, if you had a GImage containing the image on the left ( of Jan Vermeer’s The Milkmaid, c. 1659), calling flipHorizontal on that image would return a new
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: GImage as shown on the right: 2. Name Counts Write a program that asks the user for a list of names (one per line) until the user enters a blank line (i.e., just hits return when asked for a name). At that point the program should print out how many times each name in the list was entered. You may find that using a HashMap to keep track of the information entered by user may greatly simplify this problem. A sample run of this program is shown below....
View Full Document

{[ snackBarMessage ]}