Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

LinkedList ( ) ; LinkedList ( ) ; bool findCar ( int aVin ) ; bool addCar ( string model, string make, int vin, double

LinkedList();
LinkedList();
bool findCar(int aVin);
bool addCar(string model, string make, int vin, double price);
bool removeByVin(int aVin);
bool removeByModelAndMake(string model, string make);
bool changeCarInfo(int aVin, string newModelAndMake);
bool updateCarPrice(int aVin, double newPrice);
void printCarListByMake(string 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)
\table[[Function,|Function's Description],[LinkedList ();,This is the constructor of the LinkedList class. It creates an empty linked list by initialing the head to be NULL.],[L LinkedList();,\table[[This 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 findCar(int aVin),\table[[This 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 the],[corresponding aVin inside, it returns true, otherwise it returns false. Note: each Car has an unique vin, i.e. it's possible that two Cars may have the same model and make,],[but their vins must be different.]]],[,\table[[This 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 add],[it inside the linked list at a correct location.],[1. 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 in],[alphabetical order.],[2. 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.],[3. If the Car was added successfully inside the LinkedList, the function should return true; otherwise the function returns false.]]]]
image text in transcribed

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

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

Explain the various techniques of Management Development.

Answered: 1 week ago