Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use data structure to slove this question 1. Answer the following Question: given the following class public class DoubleNode { private Object info=null; private DoubleNode
- use data structure to slove this question
- 1. Answer the following Question:
given the following class
public class DoubleNode {
private Object info=null;
private DoubleNode next=null;
private DoubleNode back=null;
..
.
}
- Complete the class DoubleNode by adding the necessary methods.
- Create a class myDoubleLinkedList similar to myLinkedList (created in the lecture). This class should have at least the following methods: inserAtFront(), removeAtFront(), 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.LinkedlList.
- Create a class named Car which has the following fields. The fields correspond to the columns in the text file except the last one.
- Vehicle Name : String
- Engine Number : String
- Vehicle Price : double
- Profit : double
- Total Price : double (Total Price = Vehicle Price + Vehicle Price* Profit/100)
- In Test class, write a method named showCar (myDoubleLinkedList list, String eNumber) takes the list and Engine Number as parameters, and displays all the information of the particular car including Total Price.
- In Test class, write the main method (in Test class) to:
- Create myDoubleLinkedList list.
- 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 MyDoublylinkedlist of objects) and add each instance list (in b.1).
- Test the method showCar()
- Test the methods written in myDoubleLinkedList.
Step 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