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
|
//Le main
int main()
{
Employe* pauvres;
//Cinq* riches[3];
pauvres=new Employe; //là je fais un test et j'obtiens l'erreur.
/* for(int i=0;i<3;i++)
{
pauvres[i]=new Trente("toto",2,3);
}
*pauvres[0]=Trente("Dupont",28,2500);
*pauvres[1]=Trente("Tintin",54,2000);
*pauvres[2]=Trente("Milou",35,2900);
*riches[0]=Cinq("Picsou",88,3000);
*riches[1]=Cinq("Flairsou",77,2300);
*riches[2]=Cinq("Gripsou",66,3100);
for(int i=0;i<1;i++)
{
// pauvres[i]->getNom();
// cout<<"Le pauvre "<<pauvres[i]->getNom()<<" gagne "<<pauvres[i]->getSalaire()<<" ( "<<pauvres[i]->getTarif()<<" /heure"<<endl;
// cout<<"Le riche "<<riches[i]->getNom()<<" gagne "<<riches[i]->getSalaire()<<" ( "<<riches[i]->getTarif()<<" /heure"<<endl;
}*/
}
//Un header
class Employe{
protected:
string nom;
int heure;
int tarif;
public:
Employe();
Employe(string n, int h,int t);
Employe(Employe &e);
virtual int getSalaire()=0;
virtual void setInfoSalaire(int t,int h)=0;
string getNom();
int getTarif();
}; |
Partager