Question: answer this part only, please use java with screenshots included to undertand each step clearly(red part), you need to make from the top question,and then

answer this part only, please use java with screenshots included to undertand each step clearly(red part),

you need to make from the top question,and then provide me with the DoubleLinkedList because i have error answer this part only, please use java with screenshots included to undertand

import java.util.LinkedList;

public class MyDoubleLinkedList {

private DoubleNode front; private DoubleNode rear;

public void insertAtFront(T item) {

DoubleNode node = new DoubleNode(); node.setValue(item); node.setNext(front); if (front != null) { front.setBack(node); } if (front == null) { rear = node; } front = node; }

public void removeAtFront() { if (front == null) { System.out.println("Nothing to remove... Operation invalid..."); return; }

DoubleNode node = front.getNext(); if (node != null) { node.setBack(null); } if (node == null) { rear = null; } front = node; }

public void print() { System.out.println("List from front to end"); DoubleNode current = front; while (current != null) { System.out.println(current.getInfo()); current = current.getNext(); } }

public void printReverse() { System.out.println("List from end to front"); DoubleNode current = rear; while (current != null) { System.out.println(current.getInfo()); current = current.getBack(); } }

public LinkedList getList() {

LinkedList list = new LinkedList(); DoubleNode current = front; while (current != null) { list.add((T) current.getInfo()); current = current.getNext(); }

return list; }

}

MyDoubleLinkedList class

Exercise #2 Answer the following Question: 1. Given the following class public class DoubleNode private object info=null; private DoubleNode next=null; private DoubleNode back=null; 3 2. Complete the class DoubleNode by adding the necessary methods. 3. Create a class my Double Linkedlist similar to myLinkedList (created in the lecture) This class should have at least the following methods inserAtEronto. removeAtEconto print and printReverse Write a method that create a linked list from a double linked list using the methods available in myDoublelinkedlist and java.util.Linkedilist 4 5. Create a class named "Car" which has the following fields. The fields correspond to the columns in the text file except the last one. i Vehicle Name String 11. Engine Number String 1/2 Vehicle Price double IV. Profit double V. Total Price double (Total Price = Vehicle Price + Vehicle Price Profit/100) b) In Test class, write a method named showCat (myDoublelinkedlist list, String Numbet) takes the list and Engine Number as parameters, and displays all the information of the particular.cat including Total Price. -) In Test class, write the main method (in Test class) to 1 Create my Doublelinkeslist list 2. Read the content of the text file and for each row an instance of the class Car is created with the calculated Total Price (use My Doublxlinkedlist of objects) and add each instance list (in b.1). 3 Test the method showCaro 4. Test the methods written in max Doublelinkedlist

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!