1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| class Moteur
{
private:
string type_moteur_;
int nb_chevaux_;
public:
Moteur(string type_moteur,int nb_chevaux)
: type_moteur_(type_moteur), nb_chevaux_(nb_chevaux)
{
}
string getTypeMoteur()
{
return type_moteur_;
}
int getNbChevaux()
{
return nb_chevaux_;
}
};
class Voiture
{
private:
string type_;
string marque_;
string model_;
string couleur_;
Moteur monMoteur_(string s,int i);
public:
Voiture(string type, string marque, string model, string couleur, Moteur monMoteur)
: type_(type), marque_(marque), model_(model), couleur_(couleur)//, monMoteur_(Moteur(monMoteur.getTypeMoteur(),monMoteur.getNbChevaux()))
{
}
string getTypeVoiture()
{
return type_;
}
string getMarqueVoiture()
{
return marque_;
}
string getModelVoiture()
{
return model_;
}
string getCouleurVoiture()
{
return couleur_;
}
}; |
Partager