guys I need help in this exercise mainly after the letter d) in the creation of another class, here is the first class I did in a header file
Statement of the exercise:
1- Make a program for registration and consultation of new or used vehicles.
a) Define an Automovel class, which has the following information:
- brand - marca
- year - ano
- status (which can be sold or available)
- color - cor
- price - preco
- model - modelo
- state - estado
b) Define a constructor method for the Automovel class that initializes the values of the attributes by passing defined arguments.
c) Define the get and set methods for all attributes and methods.
d) Elaborate another class (UsaAutomovel) to test the Automovel class where:
- A list of automobiles must be created by creating objects of the Automovel class.
- Define a method for filling in data about a car and add it to the list.
e) Make a method to search for vehicles by brand lookBrand - lists the car of a certain brand.
f) make a method that allows the sale of a vehicle.
g) Define in the main class (UsaAutomovel) the following options: List cars and total sales.
2- Create two classes that inherit the characteristics of the automobile class.
#ifndef AUTOMOVEL_H
#define AUTOMOVEL_H
class Automovel
{
int ano;
string marca, modelo, cor, estado, status;
float preco;
public:
Automovel(void){
}
Automovel(string marca, int ano, string status, string cor, float preco, string modelo, string estado){
this->marca = marca;
this->ano = ano;
this->status = status;
this->cor = cor;
this->preco = preco;
this->modelo = modelo;
this->estado = estado;
}
string getMarca(void){
return this->marca;
}
int getAno(void){
return this->ano;
}
string getStatus(void){
return this->status;
}
string getCor(void){
return this->cor;
}
float getPreco(void){
return this->preco;
}
string getModelo(void){
return this->modelo;
}
string getEstado(void){
return this->estado;
}
void setMarca(string marca){
this->marca = marca;
}
void setAno(int ano){
this->ano = ano;
}
void setStatus(string status){
this->status = status;
}
void setCor(string cor){
this->cor = cor;
}
void setPreco(float preco){
this->preco;
}
void setModelo(string modelo){
this->modelo;
}
void setEstado(string estado){
this->estado;
}
void toString(){
cout << "Marca: " << this->getMarca() <<" Ano: " << this->getAno() << " Status: " << this->getStatus()<< " Cor: " << this->getCor()<< " Preco: " << this->getPreco() << " Modelo: " << this->getModelo() << " Estado: " << this->getEstado();
}
};
class UsaAutomovel
{
};
#endif // AUTOMOVEL_H
What I have tried:
I tried to create a new header library with UsaAutomoveis to make the list but I have doubts on how to assemble it