This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 15-121 FALL 2009 [CORTINA]LAB 1Download and open a copy of the PhoneDirectory project discussed in lecture: PhoneDirectory.zipIn this program, the PhoneDirectoryclass contains an array to hold the directory entries and an integer to indicate how many cells of the array contain directory entries. The directory entries are stored sequentially in the array starting from position 0 with no empty cells. So if there are 6 entries in the array, they are stored in position 0 through 5. Read through this class to understand how it works.To run the program, execute the PDApplication class. (In Eclipse, click on that class in the Package Explorer and then choose Run > Run As... > Java Application.) EXERCISES1. Add a new private helper method named getDirectoryfor the PhoneDirectoryclass that returns a single string that contains ALL of the names and phone numbers in the phone directory in the order that they are stored in the array. The string, if printed, should look like: NAME1 / NUMBER1NAME2 / NUMBER2...
View Full Document
- Spring '09
- Subroutine, Telephone exchange, The Return, telephone numbers