Unformatted text preview: 15-121: Introduction to Data Structures Exercise 09/10/2009 Relevant Reading: • Section 7.3 of the online text by Eck. • Chapter 6 of the Lewis and Chase book on Lists. ArrayLists Lab Fall 2009 Due: Thur, Sept 10 end of lab Assignment: (worth 5 exercise points) 1) Write a program ArrayLists.java that lets the user type in 10 words. You may choose the means of input (eg console, JOptionPane, etc). After all 10 words have been entered, your program should do the following things in order. print them (on one line) in the reverse order. print out the second half of the list, followed by the first half of the list (all on one line) print out all of the words with less than 5 letters in them. (on one line) ask the user for a number (call it n), and print out all words with less than that many letters in them (on one line) • ask the user for a word, and then report back to them whether or not they entered the word before • print the longest word that was entered • • • • 2) Modify the program from number 1 to let the user keep typing in words until they type in a special value (eg "Quit"). Be certain that any prompting you do tells the user what they need to do to stop. Handin: • Create a zip file containing all of the necessary java files. Submit this zip file via handin. If you have problems, contact me. ...
View Full Document
- Spring '09
- Data Structures, Longest word in English, zip file, Data Structures Exercise, reverse order. print