Question
Java. Thank you so much!!! carList is a pointer to the first node in a linked list of nodes. Use this for Parts a, b,
Java. Thank you so much!!!
carList is a pointer to the first node in a linked list of nodes. Use this for Parts a, b, and c.
Part a.
Create an inner class that will hold the following information:
the make of the car (a String), the model of the car (also a String),
the cost of the car (an int). Dont forget to include a field for the link!
Just create the class itself and the instance variables; you dont need to put any methods into the class.
Part b.
Draw a picture that explains how to delete the first node in the list. For extra credit, write Java or pseudocode to delete the first node in the list.
c.
Write Java code to traverse the linked list, printing the value of the make and model of the car each time the cost of the car is greater than $30,000.
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