Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a java program Exercise #1. Create a Java Application you must use java.util.Linkedlist 1. Create 3 lists: list1, list2, list3 in the main method

write a java program
image text in transcribed
image text in transcribed
Exercise #1. Create a Java Application you must use java.util.Linkedlist 1. Create 3 lists: list1, list2, list3 in the main method 2. Insert 10 integers (generated randomly between 20 and 60, do not insert duplicates) into list in the main method. 3. Insert 15 integers (generated randomly between 20 and 60, do not insert duplicates) into list2 in the main method. 4. Write a method to print the elements of list 5 per line 5. Write a method to find and return the smallest value in a list. 6. Write a method to find the average of the even numbers in a list. 7. Given two lists, write a method to find the elements that are in one of the list but not in the other list and insert them into a third list. 8. Write a method to print a list in reverse 9. Test these methods. I Answer the following Question: 1. Given the following class public class DoubleNode { private Object info=null; private DoubleNode next=null; private DoubleNode back-null; Exercise #2. 2. Complete the class DoubleNode by adding the necessary methods. 3. Create a class my Doublelinked List similar to myLinkedList (created in the lecture). This class should have at least the following methods: inscrAtFronto. remove AtFront.print), and printReverse(). 4. Write a method that create a linked list from a double linked list using the methods available in my Double LinkedList and java.util.LinkedlList 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. 1/2 i. Vehicle Name : String ii. Engine Number String iii. 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 showCar (myDoubleLinkedL ist list, String Number) takes the list and Engine Number as parameters, and displays all the information of the particular car including Total Price c) In Test class, write the main method (in Test class) to: 1. Create myDoublelinkedList 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 Doublylinkedlist of objects) and add cach instance list (in b.1). 3. Test the method showCard 4. Test the methods written in myDoublelinkedList

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions

Question

3. What might you have done differently

Answered: 1 week ago

Question

4. Did you rethink your decision?

Answered: 1 week ago

Question

3. Did you seek anyones advice?

Answered: 1 week ago