Create a program that holds a simple address book

Assignment Help JAVA Programming
Reference no: EM13858421 , Length: 8

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:

Firstname<space>Lastname<space>PhoneNum<space>address<newline>

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

Reference no: EM13858421

Questions Cloud

Building information modelling for infrastructure delivery : Building Information Modelling for infrastructure delivery in the kingdom of Saudi Arabia.
How many mesh cells are necessary in the matrix : Present a finite difference discretisation on the equidistant square mesh. How many mesh cells (as minimum) are necessary so that the matrix is diagonally dominant
Are you pleased with your result why or why not : Are you pleased with your result? Why or why not? What listening problems did you have with the video clip? (accent, speed, vocabulary, content depth, background, etc.) List and rank (1=most, 2= next most, etc.) them. If the problem was vocabulary..
Describe the software types : Reflect on how the software types and computer languages have evolved over time, and what this has meant for the use of these operating systems
Create a program that holds a simple address book : 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.
Identify the point group for the complete set of operations : (a) {C2(z), C2(x)}, determine the other operations that must be present to form a complete point group. [Hint: Consider all of the products of the given elements with themselves and each other.] (b) Identify the point group for the complete set of op..
Write a response to the following problems : In a sample of 12 bank tellers at a local branch office, the 7 tellers who have completed the advanced training program offered by the bank have a lower average error rate in the processing of transactions than the remaining 5 tellers
What is the character of matrix : Using its x, y, and z coordinates, construct a 15 × 15 matrix that describes the application of the S4 symmetry operation to [PtCl4]^2-. (b) What is the character of this matrix?
Distribution of law enforcement personnel and resources : In law enforcement crime data is used for many different purposes: distribution of law enforcement personnel and resources, funding of initiatives, and on a personal level, even when deciding where to live

Reviews

Write a Review

JAVA Programming Questions & Answers

  Methods are commonly used to break a problem down into

methods are commonly used to break a problem down into small manageable pieces. a large task can be broken down into

  Consider the following conditions

Consider the following conditions: An enqueuer waiting on a full-queue or a dequeuer waiting on an empty queue sleep indefinitely, unless woken up by another thread. A thread must send a signal ONLY when it adds an element to an empty queue or remove..

  A game of tic-tac-toe

A game of tic-tac-toe, two players (one the computer) take turns marking an available cell in a 3 X 3 grid (a two dimensional array) with their respective tokens (either and X or an O). When one player has placed three tokens in a horizontal

  Create application in java programming

Write method multiple that determines, for a pair of integers, whether the second integer is a multiple of the first.

  Write a program that allows a user to enter a line of text

Write a program that allows a user to enter a line of text, counts number of words and number of vowels in the sentence, and gives the average number of vowels per word in the message

  Redesign the grading program as an object-oriented design

redesign the grading program as an object-oriented design. We will start with a simple Student class. The student will have a name, an id (as a String) and a set of grades (as doubles)

  An array of integers and returns the range of values

Write a method called range that accepts an array of integers and returns the range of values in the array. The range is defined as 1 more than the difference between the maximum and minimum values in the array. For example, if an array called list c..

  String copy and string concatenation functions

Write the string copy and string concatenation functions -  Append n characters from string2 to stringl by using pointer arithmetic

  Development of a simple menu driven program

Identify all of the lines of code within the program that are associated with obtaining user input. This can be done by either copying the lines into your answers or highlighting the lines within the code.

  Evaluate the total average of all the inputs

Once the user enters in the desired amount of inputs, they will then select the second button "Calculate".

  What is the greatest common divisor

What is the greatest common divisor of the Fibonacci numbers f100 and f101 by Euclid algorithm.

  How to read data in a link list

How to read data in a link list?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd