Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 7 Problem Description Your team will develop a solution for a car dealership. The program includes two classes, Dealer and Car, and all car
Lab Problem 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:
int cars The number of cars in inventory
string name The name of the dealership
Car inventory The dealership's inventory
sizet brandLength the size of the brand field
void setBrandLengthstring bool compares the length of the parameter with the current value for brandlength. Changes the value of the field if the value of the parameter is greater than the current value. If the second parameter is true, checks the inventory array for the size of the largest brand length, and assigns it to brandLength if the value found is smaller
sizet modellength the size of the model field
void setModelLengthstring bool compares the length of the parameter with the current value for modellength. Changes the value of the field if the value of the parameter is greater than the current value. If the second parameter is true, checks the inventory array for the size of the largest model length, and assigns it to modelLength if the value found is smaller
void orderInventory
Orders the cars in inventory alphabetically, first by brand name, then by model name, and then by serial number.
public:
Dealer initializes numeric fields to name to the
empty string, and inventory to the null pointer
Dealerstring initializes numeric fields to name to
the parameter's value, and inventory to the null pointer
Dealer const Dealer& the copy constructor
Dealer the destructor
size getBrandLength const returns the value of the brandLength field sizet getModelLength const returns the value of the modellength field int getCarCount const returns the value of the cars field
void addCarstring string Receives a car's brand and model as
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