Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need this code asap please! thank you. ASSIGNMENT 2 - Review of Class Concept The purpose of this assignment is to get familiar with

i need this code asap please! thank you.
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
ASSIGNMENT 2 - Review of Class Concept The purpose of this assignment is to get familiar with the principle of Object-Oriented Design. Create a project called Assignment 2. You will then write three classes: Assignment2.java - A driver class that contains only a main method which should do following: Create a new Phone Directory object While (true) { Prompt user to enter command; if (command is "a") { Prompt user for name and number: Create a phone record and store it in the database; } else if (command is "f") Prompt user for search key; Search the database for records whose names begin with the search key; The user doesn't need to enter an entire name. The program will display all names that begin BUY.ALEES Assignment2.java - A driver class that contains only a main method which should do following: Create a new Phone Directory object While (true) { Prompt user to enter command; if (command is "a") { Prompt user for name and number: Create a phone record and store it in the database; } else if (command is "f") { Prompt user for search key; Search the database for records whose names begin with the search key; (The user doesn't need to enter an entire name. The program will display all names that begin with the characters entered by the user. The case of the input doesn't matter) Print these names and the corresponding phone numbers; } else if (command is "q") { Terminate program; } else { Display error message: } User Interface Enter command (a, f, or q): a Enter new name: Abbott, C. Michael Enter new phone number: 776-5188 Enter command (a, f, or q): f Enter name to look up: Abbott Abbott, C. Michael 776-5188 Enter command (a, f, or q): f Enter name to look up: ab Abernathy, C. 779-7559 Abbott, C. Michael 776-5188 Enter command (a, f, or q): 9 ENGLISH (UNITED STATES) PhoneDirectory.java - This class contains an array of Phone Record objects. It should have the following data attributes and methods: **SA Times Ne-12 Styles private int numRecords - number of records in the array private Phone Record] data - array of PhoneRecord objects public Phone Directory0 - constructor that should initialize memory for data array and numRecords value public void enterPhone Records(Phone Record new_record) - store a new phone record in the database public void findPhone Record(String key) - Search the database for records whose names begin with the search key. The user doesn't need to enter an entire name. This method will display all names that begin with the characters entered by the user. The case of the input doesn't matter. If the customer number is not in the array, the program will print that the phone record does not exist". PhoneRecord.java - a class that contains the following data attributes and methods: private String name - the customer's name private String number - the customer's phone number public Phone Record(String person Name, String phone Number) - constructor value public void enter Phone Records(Phone Record new_record)-store a new phone record in the database public void findPhone Record(String key) - Search the database for records whose names begin with the search key. The user doesn't need to enter an entire name. This method will display all names that begin with the characters entered by the user. The case of the input doesn't matter. If the customer number is not in the array, the program will print that the phone record does not exist". PhoneRecord.java - a class that contains the following data attributes and methods: private String name - the customer's name private String number - the customer's phone number public Phone Record(String personName, String phone Number) - constructor get/set Methods for each data attribute public String toString() - Special method to be used when printing a phone Record object You should have correct comments and documentation like

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is order of reaction? Explain with example?

Answered: 1 week ago

Question

Derive expressions for the rates of forward and reverse reactions?

Answered: 1 week ago

Question

Did the team members feel that their work mattered

Answered: 1 week ago

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago