Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void search() {
- String search;
- System.out.print("Please type the last name, email, or zip code you are searching for: ");
- Scanner scan = new Scanner(System.in);
- search = scan.nextLine();
- int e = 0;
- int count = 0;
- while (e < listSpot) {
- while (null != list[e]) {
- if (search.equalsIgnoreCase(list[e].getLastName()) || search.equalsIgnoreCase(list[e].getEmail()) || search.equalsIgnoreCase(list[e].getZipCode())) {
- System.out.print("\n" + ++count + ": ");
- list[e].printContact();
- }
- e++;
- }
- if (count < 1) {
- System.out.println("No matches found for: " + search);
- }
- }
- }
Add Comment
Please, Sign In to add comment