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
| // vehicule.cpp: implementation of the vehicule class.
#include<iostream>
#include "vehicule.h"
using namespace std;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
vehicule::vehicule()
{
imatriculation="";
marque="";
kilometre=0;
date_mise_circulation="";
}
vehicule::vehicule(string matr,string marq, double km, string date)
{
imatriculation=matr;
marque=marq;
kilometre=km;
date_mise_circulation =date;
}
void vehicule::affiche()
{
cout<<"la vehicule de matrucule: "<<imatriculation<<"\t de marque: "<<marque<<endl;
}
ostream& operator<<(ostream & sortie,vehicule & veh)
{
sortie<<"la vehicule de matrucule: "<<veh.imatriculation<<"\t de marque: "<<veh.marque<<"\tkm: "<<veh.kilometre<<endl;
return sortie;
} |
Partager