Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Java menu-driven program that creates and manipulates a directory of nam

ID: 3694546 • Letter: W

Question

Write a Java menu-driven program that creates and manipulates a directory of names, telephone numbers, and home addresses. The following information will be stored for each person in the directory:

- Name (Last, First)

- Home address (street address, city, state, zip code)

- Home telephone number

Your program should use an Array data structure to store the directory entries and should be able to perform the following basic functions. The directory should remain an sorted after each of the operations below:

- Display the entire directory in sorted order by key value (combination of last and first names)

- Search and display the contents of a particular entry

- Delete an existing entry

- Insert an entry

You must use three classes: entry class, directory class, and a driver. The program used is BlueJ. Please show where you used the three differenent classes and PLEASE INCLUDE COMMENTS

Explanation / Answer

program :

   import java.util.ArrayList;
import java.util.Scanner;
public class mainClass
{
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
System.out.println("Plz enter Name : ");
String name = input.nextLine();
System.out.println("Plz enter Address : ");
String address = input.nextLine();
System.out.println("Plz enter ContactNo : ");
String contact = input.nextLine();
ArrayList<Data> Contacts = new ArrayList<Data>();
Data objt = new Data();
Contacts.add(objt.Data(name, address, contact));
}
}
public class Data
{
private String name = "";
private String address = "";
private String cell = "";
public void Data(String n, String a, String c){
name = n;
address = a;
cell = c;
}
public void printData()
{
System.out.println("Name Address ContactNo");
System.out.println(name + " " + address + " " + cell);
}
}

     

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote