Question: Objectives: To gain experience with Java's Linked List. Documentation: 1. Explain the purpose of the program as detail as possible - 8%. 2. Develop a

Objectives:

To gain experience with Java's Linked List.

Documentation:

1. Explain the purpose of the program as detail as possible - 8%.

2. Develop a solution for the problem and mention algorithms to be used -12%

3. List data structures to be used in solution. - 5%.

4. Give a description of how to use the program and expected input/output - 5%

5. Explain the purpose of each class you develop in the program. - 5%.

Programming:

1. For each method, give the pre and post conditions and invariant, if any - 10%

2. Program execution according to the requirements given 50%

3. Naming of program as required 5%

Description of Program

You are to write a program name bankrecord.java that maintains a list of records containing names and phone numbers. The program will prompt the user for a command, execute the command, then prompt the user for another command. The commands must be chosen from the following possibilities:

Show all records

Delete a selected record

Change the first name of a selected record.

Change the last name of a selected record

Add a new record

Change the phone number of a selected record

Withdraw an amount requested by the record

Add a deposit for a selected record

Quit.

The following example illustrates the behavior of each command (user input is in bold)

c:\java bankrecord [enter] A Program for a Bank:

Show all records

Delete a selected record

Change the first name of a selected record.

Change the last name of a selected record

Add a new record

Change the phone number of a selected record

Withdraw an amount requested by the record

Add a deposit for a selected record

Quit.

Enter a command from the list above (9 to quit): 2

No record selected

Show all records

Delete a selected record

Change the first name of a selected record.

Change the last name of a selected record

Add a new record

Change the phone number of a selected record

Withdraw an amount requested by the record

Add a deposit for a selected record

Quit.

Enter a command from the list above (9 to quit): 5

Enter first name: Barry

Enter last name: Drake

Enter phone number: 770-591-8071

Enter balance: $2000.00

Show all records

Delete a selected record

Change the first name of a selected record.

Change the last name of a selected record

Add a new record

Change the phone number of a selected record

Withdraw an amount requested by the customer

Add a deposit for a selected record

Quit.

Enter a command from the list above (10 to quit): 5

Enter first name: Ada

Enter last name: Caswell

Enter phone number: 770-251-3456

Enter balance: $1000.00

MENU DISPLAYED AGAIN

Enter a command from the list above (9 to quit): 1

First Name Last Name Phone Number: Balance.

------------- ------------- ------------- ------------- Ada Caswell 770-251-3456 $1000.00 Barry Drake 770-591-8071 $2000.00

MENU DISPLAYED AGAIN

Enter a command from the list above (9 to quit): 5

Enter first name: Elwood

Enter last name: Havens

Enter phone number: 404-345-8897

Enter balance: $50.00

MENU DISPLAYED AGAIN

Enter a command from the list above (9 to quit): 1

First Name Last Name Phone Number: Balance. ------------- ------------- ------------- ------------- Ada Caswell 770-251-3456 $1000.00 Barry Drake 770-591-8071 $2000.00 Elwood Havens 404-345-8897 $2000.00

MENU DISPLAYED AGAIN Enter a command from the list above (9 to quit): 8

[For this activity display the current list of customer]

Enter the First name of the record you want to add a deposit:Elwood

Now enter the last name:Havens

The record is: Elwood Havens who currently has: $50.00

Enter the deposit amount:200.00

This record now has $250.00

MENU DISPLAYED AGAIN

Enter a command from the list above (9 to quit): 4

[For this activity display the current list of customer]

Enter the First name of the record you want to change the last name of: Elwood

Enter the First name of the record you want to change the last name of: Havens

Now enter the new last name: Brown

MENU DISPLAYED AGAIN

Enter a command from the list above (9 to quit): 1

First Name Last Name Phone Number: Balance. ------------- ------------- ------------- ------------- Elwood Brown 404-345-8897 $250.00 Ada Caswel 770-251-3456 $1000.00 Barry Drake 770-591-8071 $2000.00

MENU DISPLAYED AGAIN

Enter a command from the list above (9 to quit): 4

[For this activity display the current list of customer]

Enter the First name of the record you want to change the last name of: Elwood

Enter the First name of the record you want to change the last name of: Havens

Now enter the new last name:Brown

MENU DISPLAYED AGAIN

Enter a command from the list above (9 to quit): 7 [For this activity display the current list of customer]

Enter the First name of the record you want to withdraw from:Elwood

Now enter the last name: Brown

Enter amount to be withdrawn: 100.00

This record now has $150.00

MENU DISPLAYED AGAIN

Enter a command from the list above (9 to quit): q

Illegal command

Enter a command from the list above (9 to quit): 9

The output of your program must match the format illustrated in this example.

Here are some other additional requirements for this program:

You may assume that phone number contains no spaces.

After a deletion, there is no record currently selected

Each record (first name, last name and phone number) must be stored as an object. These objects must be stored in a Linked List.

The Linked List must be kept sorted at all times based on last name. Sorting is to be achieved when an insertion or modification is done. NO SORTING ROUTINE IS ALLOWED. ALWAYS INSERT A NEW RECORD OR EDITED RECORD INTO ITS' CORRECT PLACE IN THE LINKED LIST. Note: Changing the last name will require resorting.

Use as many generic algorithm as you can.

// Make another class named userList

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!