Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

New concepts tested by this program Hash Tables You will be creating a program that holds a simple Address Book and then lets you do a reverse phone number look up. You will be storing the address book in a hash table implemented with buckets/chaining.

You will be creating a program that holds a simple Address Book and then lets you do a reverse phone number look up. You will be storing the address book ina hash table implemented with buckets/chaining.

Data Element - Person

Create a class Person which implements PersonInterface. The hashCode method should return an integer based on the following hash function:
hashcode = (p1 * (areaCode + p2 * exchangeCode) + extensionCode)

the key is the phone number as a string in the form: (XXX)XXX-XXXX

p1 is the prime 23 and p2 is the prime 31
In the phone number (555)123-4567
areaCode = 555
exchangeCode = 123
extensionCode = 4567

if the hashcode is negative - use the absolute value

Data Structure - HashTable

Create a class HashTable which implements HashTableInterface with buckets. You can use an array of linked lists(of Person objects).You may add any other methods you think are necessary.

Data Managers - AddressBookUtility

Createa class AddressBookUtility that implements the AddressBookUtilityInterface. This class will use an object of yourHashTableclass to hold the Person objects for the address book. The format of the file to be read from or written to is as follows:

FirstnameLastnamePhoneNumaddress

Example:

John Smith (222)555-2345 2310 Oak St., Willmington, VA 24488

You can assume all first names and last names will only be one word (no spaces)

Exception Classes - KeyInUseException, InvalidKeyException

The phone numbers in this address book must be unique because we are using them as the key to place them in the hash table (I know it's not ideal, but it simplifies the program). If a Person object being added to the hash table has the same phone number as an object in the hash table, the KeyInUseException will be raised.

If the key is not in the format (XXX)XXX-XXXX where the X is a digit, the InvalidKeyException will be raised.

GUI Driver

If the user selects the Read Text File button, use the FileChooser to ask the user for the location of the text file to be read. If the user selects Add, retrieve the information from the textbox fields and add to the address book. When the user selects Reverse Look Up, retrieve all the phone numbers in the left text area and print the corresponding lastname and firstname for that phone number. When the user selects Write Text File, use the FileChooser to ask the user for the location of the text file to be written to. When the user selects Exit, the program terminates.

Attachment:- Assign.zip

Java, Programming

  • Category:- Java
  • Reference No.:- M91519186
  • Price:- $120

Guranteed 48 Hours Delivery, In Price:- $120

Have any Question?


Related Questions in Java

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Simple order processing systemquestion given the classes

Simple Order Processing System Question: Given the classes Ship (with getter and setter), Speedboat, and SpeedboatTest. Answer the following questions: Refine the whole application (all classes) and create Abstract class ...

Assessment instructionsin this assessment you will complete

Assessment Instructions In this assessment, you will complete the programming of two Java class methods in a console application that registers students for courses in a term of study. The application is written using th ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Assignment - java program using array of objectsobjectives

Assignment - JAVA Program using array of objects Objectives - This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details - For this assignment, you are required to develop a Menu ...

Solving 2nd degree equationsbull write the following java

Solving 2nd degree equations • Write the following Java methods • boolean real-sols(double a, double b, double c): it returns true if the 2nd degree equation ax2 + bx + c has real solutions • double solution1(double a, d ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Part a specification - robot simulationpart a

PART A Specification - Robot Simulation PART A Requirements To complete this assignment you will use the supplied eclipse project Robot P1/. It is already set up to execute a simple arm movement loop which you will build ...

Assessment -java program using array of Assessment -JAVA Program using array of objects

Assessment -JAVA Program using array of objects Objectives This assessment item relates to the course learning outcomes as stated in the Unit Profile. Details For this assignment, you are required to develop a Windowed G ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As