Question: Assignment5.java will implement the general version of linked list. public class Assignment5 { public static void main(String[] args) throws IOException { Create a new LindedList

![Assignment5 { public static void main(String[] args) throws IOException { Create a](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3339a7c367_49066f3339a1bf8f.jpg)








Assignment5.java will implement the general version of linked list. public class Assignment5 { public static void main(String[] args) throws IOException { Create a new LindedList object Read a file called fileName which is a text file containing lines (records) of valueData. This method fills the linked list with value Data from the file. The file will have the following format: String valueOfString While (true) { Prompt user to enter command; While (true) { Prompt user to enter command; if (command is "f") { //find variable's value given its name Prompt the user to enter variable's name and then displays the corresponding value of variable on the screen; } else if(command is "r"){ //delete a record at the front Delete the first node from the singly linked list. Display the data of the deleted node. Print content of linked list for debugging purpose else if(command is a){ l/add the record at the front else if(command is a){ //add the record at the front Ask user for variable's name and variable's value. Then create Value Data object. add it to the front of list Print content of linked list for debugging purpose } else if (command is "q") { Terminate program; } else { Display error message; } else if (command is "q") { Terminate program; } else { Display error message; } } }llend of main /*this function find the node with given variable and return the corresponding value of variable*/ public static float find(LinkedListNode head, String var){ } llend of class LinkList.java - This class contains a singly linked list of objects. It should have the following data attributes and methods: public class LinkedList { private LinkedListNode head; /** Creates a new instance of LinkedList */ public LinkedList() { } public LinkedListNode getHead() } public LinkedListNode getHead() public void setHead(LinkedListNode head) /*add item at the front of linked list*/ //Object is root of class tree. Object means that it can represent any object //this will make our code flexible public void insertFront(Object item) /*remove item at the front of linked list and return the object variable*/ public Object removeFronto } LinkedListNode.java public class LinkedListNode { private Object data; private LinkedListNode next; l/constructor public LinkedListNode(Object data) //you also need define getter and setter public LinkedListNode getNexto public void setNext(LinkedListNode next) Iyou also need define getter and setter public LinkedListNode getNexto public void setNext(LinkedListNode next) public Object getDataO Times 1 public void setData(Object data) ValueData.java public class valueData { private String variable; private double value; //you need define constructor //you need define getter and setter //you need define toString method } values.txt (each line contains variable's name and variable's value) 2017
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
