Question: Please solve in C++. Follow the instructions provided. Team Project Description Your team will develop a solution for a car dealership. The program includes two

Please solve in C++. Follow the instructions provided.
Please solve in C++. Follow the instructions provided. Team Project Description Your
team will develop a solution for a car dealership. The program includes
two classes, Dealer and Car, and all car objects are created by
the Dealer object. The fields and methods required for each class are:
class Dealer private: unsigned short count // The number of cars in

Team Project Description Your team will develop a solution for a car dealership. The program includes two classes, Dealer and Car, and all car objects are created by the Dealer object. The fields and methods required for each class are: class Dealer private: unsigned short count // The number of cars in inventory string name Car** inventory unsigned short brandLength void setBrandtangth (string) 17 compares the length of the parameter + 2 with the current value for brandlength. If the value of the parameter + 2 His greater than the current value, changes it void reduceBrandLength() 17 checks the inventory array for the size of the largest brand length, and assigns it to brandlength if the value 1 Cound smaller unsigned short modelLength void setModelLength (string) V compares the length of the parameter - 2 with the current value for model Length. If the value of the parameter 2 Vis greater than the current value, changes se void reduceModel Length() W check the Inventory array for the size of the largest 7 model length, and assist to model length in the value found 1 smaller void order Inventory () H orders that can Inventory alphabetically by brand name, then by model nant, and then by number public: Dealer inte alites numeric Fields of name to the empty string, and inventory to the null pointer Dealer (string) // initializes numeric fields to 0, name to // the parameter's value, and inventory to the null pointer void adacar (atring, string) // Receives a car's brand and model as parameters. Creates a 1/ new Car object and adds it to Inventory, increments count, // and calls the setModelLength, setBrandLength, and // order Inventory methods void sellcar(string, string) // Receives a car's brand and model as parameters. Calls // findCar to make sure there is a car with the same brand // and model in inventory, if not the method ends. If found, // removes the car from inventory, decrements count, invokes // the Car object's destructor and calls the 1/ reduceModelLength and reduceBrandLength methods. void sellCar (string) // Receives a car's serial number as parameter. Calls // findCar to make sure there is a car with the same serial 1/ number in inventory, if not the method ends. If found, 1/ removes the ear from inventory, decrements count, invokes 11 the car object's destructor and calls the 11 reduceModellength and reduceBrandLength methods. void findCar (string, string) const I receives a car's brand and model as parameters and I searches the inventory for a car with the given brand and 77 model names. It found, returns the index number of the V. First Instance, otherwise, returns -] void findCar (string) const H receives a car's serial number as parameter and searches 4 the inventory for the serial number. I found, returns the index number, otherwise, returns - 1 void printBrand Inventory() const 11 points the count of cars per brand. First, it prints the / phrase "Dealer (name] has quantity of cars in inventory. It then prints a table with the headers BRAND and COUNT, W using brandLength as the size of the BRAND column. If there 17 are no cal's in inventory, the table (including the headers) // is not printed. void printModelInventory () const // prints the count of cars per model. First, it prints the // phrase "Dealer [name] has (quantity] of cars in inventory." 7/ It then prints a table with the headers BRAND, MODEL, and 1/ COUNT, using brandLength as the size of the BRAND column, // and model Length as the size of the MODEL column. If there 11 are no cars in inventory, the table (including the headers) 17 is not printed. void printDetailedInventory () const 1/ Prints a detailed inventory. First, it prints the 11 phrase "Dealer (namel has (quantity of cars in inventory." // It then prints a table with the headers BRAND, MODEL, and 11 SERIAL NUMBER, using brandLength as the size of the BRAND // column, and modelLength as the size of the MODEL column. // If there are no cars in inventory the table (including // the headers) is not printed. class Car private: static unsigned short count 1/ count is the number of Car objects created string brand string model string serialNumber string assignSerialNumber() assignSerialNumber is a private method which considers If the brand, model, and count to create a 9-symbol string. 1/ The format is first three letters of the brand, first three 7 letters of the model and the 3-digit count value IE & Toyota Yaris is the first car added, the serial number W would be TOYYAR001 17 I the brand and model fields have not been assigned a 7 value, the method DOES NOT create a serial number, and // returns the empty string public: Car() // Assigns the empty string to all three fields, and // increments count by 1 Car (string, string) // The parameterized constructor increments count by 1 17 assigns the brand and model to the fields, and calls // the assignSerialNumber method to create the serial number -Car() // The destructor prints the message 7/ "The car (brand) (model) with serial number (serial number) 7 has been sold" void setBrand (string) // sets brand value IFF not set before void setModel (string) // sets model value IFF not set before string getBrand() const // If no brand, return empty string string getModel() const // If no model, return empty string string getSerialNumber() const // Returns the empty string if serial number not set void printCar (unsigned short, unsigned short) 77 printCar prints the car's details in a table-like manner 77 using the format car_brand car_model serial number 7) It uses the parameters as the size of the brand and model 17 Eields, and prints N/A is the fields have no value Once both classes have been defined implement the solution in a file named finalProject.cpp. This file, which includes main, uses a series of methods to present the human user with an interface to add cars to inventory, sell cars from inventory, and print all versions of the inventory. The menu method must show the following menu: Select one of the following: 1. Add a car to inventory 2. Sell 2 cer from inventory 3. Find a car by brand and model 4. Print the brand inventory 5. Print the model inventory 6. Peint the detailed inventory 7. Exit the application Your selection: The method returns an integer value which should be used by the execute method to implement the selected option. The execute method receives and integer as parameter and performs the requested action by calling upon methods of the Dealer object. If the value of the parameter is incorrect the execute method prints an error message. The execute method returns true unless the selected option is number 7. The structure of main is: int main() { Dealer poli ("Poli Auto Sales"); while (execute (menu ()); system ("pause"); // Visual Studio only! return 0; You should add at least 10 cars to inventory and make sure that all methods work properly. Your team will present the program to the class on the scheduled date and time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!