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

Project Program: write pseudocode to design a phone contact list program. Your p

ID: 3838830 • Letter: P

Question

Project Program: write pseudocode to design a phone contact list program. Your program includes a Graphical User Interface that allows user to add new contacts, update existing contacts, search specific contact from the contact list, sort the contact list in ascending or descending order, delete an old contact. Your program should also provide help screen, an exit button to close the program and displays error messages for any exceptions

Input:

§ Write a data text file with a list of phone number (10 digits with dashes, 555-555-5555)

§ Read text file to retrieve contact info (phone number, first name, last name)

o   Read the file into memory (hint: parallel arrays)

§ Individual contact info can also be entered from the keypad

Process: (open/read the file, display the menu, close file)

§ Maintain the phone list by ADD, UPDATE, DELETE, INQUIRE/SEARCH, SORTING

o   When each item on the menu is done, redisplay the menu

Output: (per each navigation menu item)

Ø Design a GUI screen that include

o   Keypad with numbers

o   Navigation menu

§ Add New Contact ( textbox for first name, last name, textbox for phone number)

§ Update Contact (search by phone number to display name and phone OR search by name to display name and phone number)

§ Delete Contact from List (change name to blank)

§ Inquire: enter phone name or name

§ List: Sort list either ascending or descending order by first name or last name

§ Help

§ Save phone list

§ Exit

Ø Define a CONTACT class

o   Fields (phone number, first name, last name)

o   Set & get method

o   Constructor

o   Methods (add, update, delete, save, sort, display the list etc. )

Ø Object: personal contact list Or company phone directory (inheritance)

o   Public class PersonalContact extends Contact { }

Add:

Enter phone number (phone number: range 1-999)

If not found – display message

If name is blank, enter name (first and last)

If name NOT blank, save contact info, display confirm message

Change:

Enter phone number

If not found – display message

IF found – display name and ask for new name

If name is blank, ask for new name

Delete:

Enter phone number

If not found – display message

If found – display name and confirm delete

                If confirm is yes – blank out name

                If confirm is no – return to menu

If name is blank, display message

Inquire:

Enter phone number

If found – display name

If not found – display message

If found and name is blank – display message

Sort:

Question: sort ascending, descending or return to menu

If return to menu, then return to menu

If ascending- sort phone number ascending

If descending - sort phone number in descending order

After sort, display phone list

Help:

Display menu option and a one description of the function

Save:

Write phone list back to file

Exit:

If file is open, save phone list, close file

Terminate program

Error:

If a menu selection is made that is not displayed (1-9)

Issue message and display the help screen

Explanation / Answer

Introduction

           In computer science, a data structureis a particular way of organizing data in a computer so that it can be used efficiently. Different kinds of data structures are suited to different kinds of applications, and some are highly specialized to specific tasks.

           Data structures provide a means to manage large amounts of data efficiently, such as large databases and internet indexing services. Usually, efficient data structures are a key in designing efficientalgorithms. Some formal design methodsand programming languages emphasize data structures, rather than algorithms, as the key organizing factor in softwaredesign. Storing and retrieving can be carried out on data stored in both main memory and in secondary memory.

            Data structures are generally based on the ability of a computer to fetch and store data at any place in its memory, specified by a pointer-a bit string, representing a memory address that can be itself stored in memory and manipulated by the program. Thus, the array and recorddata structures are based on computing the addresses of data items with arithmetic operations; while the linked data structuresare based on storing addresses of data items within the structure itself. Many data structures use both principles, sometimes combined in non-trivial ways (as in XOR linking).

           The implementation of a data structure usually requires writing a set ofprocedures that create and manipulate instances of that structure. The efficiency of a data structure cannot be analysed separately from those operations. This observation motivates the theoretical concept of an abstract data type, a data structure that is defined indirectly by the operations that may be performed on it, and the mathematical properties of those operations (including their space and time cost).

Project Description

The appropriate data structure used for this project is hashing.

In computing, a hash table (also hash map) is a data structure used to implement an associative array, a structure that can map keys to values. A hash table uses a hash function to compute an index into an array of buckets or slots, from which the correct value can be found.

A telephone directory, also known as a telephone book, telephone address book, Phone book or the white/yellow pages, is a listing of telephone subscribers in a geographical area or subscribers to services provided by the organisation that publishes the directory. Its purpose is to allow the telephone number of a subscriber identified by name and address to be found.

Creating Hash Table To Store Data Basing Name As Key

To Create Hash table to store the data of names, telephone numbers based on name as a key.

In this module we will insert the data. We will insert the name of the person and the phone number related to that person. We create a hash table to store the data. We use insert function and in that function we will call the hash function. We declare the hash table also.

Creating Hash Table To Store Data Basing Number As Key

To Create Hash table to store the data of names, telephone numbers based on telephone number as a key.

In this module we will write the logic to find the phone number when name was asked. It means when we give the name to be searched it has to search the name and display both the name and the phone number related to that person.

Searching, Displaying And Deleting Basing On Name

To search the hash table based on query for name. In this module we will the logic to find the name when the phone number related to that person was given. When we give a phone number to search it has to search for that phone number and display both the phone number and name.

Ex: the following are the entries of telephone directory.

Sai kiran        912399482

Satish            949278583

Sarath            0920542939

Surendar        9349294845

If the user queries for sai* then it should display sai kiran records.

Searching, Displaying And Deleting Basing On Phone Number

To search ,delete and to display the hash table based on query for phone number.

Ex:for the above given data if the user queries for 949278583* then it should display name satish.

Algorithm

1. Create a Hashtable and its node consisting of Telephone number and name.

2. Hash Function is: int hf(char *s)

{

int i,sum=0;

for(i=0;s[i]!='';i++)

sum=sum+s[i]*(i+1);

return (sum*1/2)%tablesize; or return(sum*1/4)%tablesize

}

3.Insert values into hashtable by this hash function.

4.Search the names by using numbers and numbers using names.

Pseudocode:

1. collect everybody's phone number, address, and the name they wish to be listed under; perhaps an option is not to have any address listed ?

2. create a relational database where the phone number functions as UniqueID. create the tables and links between tables so that given any one of the three pieces of information you can easily query the database for the other corollary information

2.a. create a user interface for entering the data collected in step #1 in such a way that each type of data item is validated, and, of course, sorted properly. the functioning of this program to be determined by the data-entry method in step #3,

3. enter the data via ocr/automation, or manual entry by low-paid wage-slaves.

4. create a custom program that iterates the entire database and generates a pdf file which you then can send to your printer.

5. create a custom client user interface for authorized persons who have security clearance to look up information in the database. create custom security procedures for emergency or police queries.

6. figure out how much money has been allocated for this project.

7. submit a bill for 250% more than the amount allocated, and then negotiate the final payment down to 150% or so.