Answered step by step
Verified Expert Solution
Question
1 Approved Answer
No input file needed ASSIGNMENT 4- Linked List Implementation The purpose of this assignment is to get familiar with the linked list. Create a project
No input file needed
ASSIGNMENT 4- Linked List Implementation The purpose of this assignment is to get familiar with the linked list. Create a project called Assignment 4. You will then write four classes: Assignment4.java - A driver class that contains only a main method which should: Create a new Customer List object Prompt the user to enter a file name Call the getCustomer ListO method with the file name that the user entered While (true) Prompt user to enter command; if (command is "a") { Prompt user for customer Number firstName last Name balance; Create a new Customer List object Prompt the user to enter a file name Call the getCustomer List() method with the file name that the user entered While (true) { Prompt user to enter command; if (command is "a") { Prompt user for customerNumber firstName lastName balance; Create a customerRecord and inserts the customer record at the head of a singly linked list; } else if (command is "f"){ Prompt the user to enter a customer number and then displays the corresponding record on the screen } else if(command is "d"){ Delete the first customer record from the singly linked list. } else if(command is "r"){ Prompt the user to enter a customer number; Delete the given customer record corresponding to the customer number from the singly linked list; If the customer number does not exist, please show the error message: } else if(command is "n"){ Call getTotalCustomer Numbers method and then displays the total number of customers in the Prompt the user to enter a customer number; Delete the given customer record corresponding to the customer number from the singly linked list; If the customer number does not exist, please show the error message: } else if(command is "n"){ Call getTotalCustomer Number() method and then displays the total number of customers in the database on the screen else if (command is "q") { Prompt the user to enter a file name to save the latest update; Save the information in the database to the file specified by the user; Terminate program; } else { Display error message; 3 customerList.java - This class contains a singly linked list of customerRecord objects. It should have the following data attributes and methods: public class customer List private Node head; /*this is the reference variable to the first node of linked list* public customer List - build the list object public void getCustomer List(String fileName) - reads a textfile and fills the linked list with the records from the file. public customerRecord getCustomerRecord(int customer Number) - returns the object corresponding to the customer with specified customer number. If the customer number is not in the linked list, return null, (check search function) We customer Wie speum UUStoner TULI MUSTOM De ISTIOT me mire HIS, TCI Tie 12 mull. (check search function) AXA FU.AE. public void enterCustomerRecord(customerRecord new_record) - inserts the customer record at the head of a singly linked list (check insert function) public void remove FirstCustomer Record O-delete the first customer record from the linked list (check removeFirstNode) public int getTotalCustomerNumber counts the number of customers in a singly linked list. public void saveCustermer List(String filename) - save the information stored in the linked list to the file called filename public void removeCustomer Recordint customer Number) -- delete the given customer record corresponding to the customer number from the linked list. If the customer number does not exist, please show the error message. (check removeNode) Node.java /** Node of a singly linked list of customerRecord. */ public class Node private customerRecord element; private Node next; /** Creates a node with the given element and next node * public Node( customerRecords) { element = s; next = null; } /** Returns the element of this node. public customerRecord getElemento { return element: /** Returns the next node of this node. */ public Node getNext { return next; } // Modifier methods: SUSU UXL nou or US HOC public void setNext(Node newNext) next = new Next; customerRecord.java - a class that contains the following data attributes and methods: private int customer Number - a unique number assigned to each customer private String firstName - the customer's first name private String lastName - the customer's last name private float balance - the customer's balance get/set Methods for each data attribute public String toStringo - Special method to be used when printing a customer Record object Please add adequate comments for full credits SUS W X UV or Us Hours public void setNext(Node newNext) next = newNext; customerRecord.java - a class that contains the following data attributes and methods: private int customer Number - a unique number assigned to each customer private String firstName - the customer's first name private String lastName - the customer's last name private float balance - the customer's balance get/set Methods for each data attribute public String toStringo - Special method to be used when printing a customerRecord object Please add adequate comments for full creditsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started