Professional Documents
Culture Documents
CSIS 130 - Computer Programming II HW5: HW I L O
CSIS 130 - Computer Programming II HW5: HW I L O
HW 5
Due: Wednesday December 23 2022, 9 PM
HW INSTRUCTIONS
LEARNING OUTCOMES
The purpose of this assignment is (1) to introduce students to the Java Collection interfaces
(Set and Map) and their implementations (LinkedList and HashMap), (2) to get more
practice in I/O operations. We achieve this by implementing a phonebook that allows for
collecting and retrieving contact information (phone numbers, emails, and addresses). It
also provides methods for saving contact information to output streams and loading them
later from input streams.
7 public void setContactInfo(String name, String phone, String email, String address) {
9 }
12 }
15 }
18 }
21 }
24 }
27 }
30 }
4 }
35 }
Figure 1: Skeleton for the Phonebook class. See Figure 2 and Figure 3 for the definitions
of the two inner-classes Info and NameNotFoundException.
Figure 2: The Phonebook.Info class: this is an inner-class that should go inside Phonebook
(see Figure 1, line 3)
8 @Override
9 public String toString() {
10 return String.format("NameNotFoundException<%s>", name);
11 }
12 }