Answered step by step
Verified Expert Solution
Question
1 Approved Answer
LinkedList ( ) ; LinkedList ( ) ; bool findCar ( int aVin ) ; bool addCar ( string model, string make, int vin, double
LinkedList;
LinkedList;
bool findCarint aVin;
bool addCarstring model, string make, int vin, double price;
bool removeByVinint aVin;
bool removeByModelAndMakestring model, string make;
bool changeCarInfoint aVin, string newModelAndMake;
bool updateCarPriceint aVin, double newPrice;
void printCarListByMakestring make;
void printCarList
;
In this assignment, according to above class definition, you need to finish each of above functions according to the following description.within LinkedList.h file
tableFunctionFunctions DescriptionLinkedList ;This is the constructor of the LinkedList class. It creates an empty linked list by initialing the head to be NULL.L LinkedList;tableThis is the destructor of the LinkedList class. It should delete all Car objects in the linked list and perform garbage collection free the memory At the end, it should print:The number of deleted Car is: where is the number of deleted Cars in the linked list.bool findCarint aVintableThis is the linear search function in LinkedList class. It search the linked list by the given parameter vehicle identification number aVin, if it found the Car with thecorresponding aVin inside, it returns true, otherwise it returns false. Note: each Car has an unique vin, ie it's possible that two Cars may have the same model and make,but their vins must be different.tableThis function adds a new Car into the linked list by using the parameter values model, make, vin and price of the Car. It needs to create an object of the struct Car and addit inside the linked list at a correct location. First, the Car should be added in alphabetical order of their makes, if two or more Cars have the same makes, then it should be added according to their models, again inalphabetical order. If two or more Cars have exactly the same model and make possible then they should be added in the increasing order of their vins. Note: each Car has an unique vin. If the Car was added successfully inside the LinkedList, the function should return true; otherwise the function returns false.
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