I need to create a program that will read names and phone numbers from a text file. I then need to search for a phone number by providing a last name, I will also need to be able to add a name and phone number and also be able to delete a name and a phone number.

Can anyone help me please?

This is what I have so far:

File file = new File("phones.txt");

try {

scanner = new Scanner(file);

while (scanner.hasNextLine()) {

String line = scanner.nextLine();

System.out.println(line);

}//end of while

} catch (FileNotFoundException e) {

e.printStackTrace();

}

All this does is read from a text file and then print the names and phone numbers. I need to be able to search for similar last names in that text file and provide the full names and phone numbers for that last name. I really need help with this !!