Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1779 connectés 

  FORUM HardWare.fr
  Programmation
  C++

  un devoir que j'arrive pas à le faire...aidez moi svp....merci

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

un devoir que j'arrive pas à le faire...aidez moi svp....merci

n°222879
NathalieCo​m
Posté le 02-10-2002 à 19:12:38  profilanswer
 

svp corrigez moi , j'ai un travaille à remettre , et c'est côté
.... peut-étre je suis conne mais je comprend pas les erreurs..
je vous remercie d'avance.....
 
 
 
e:\documents and settings\lili\bureau\vehicul.cpp(52) : error C2236: unexpected 'class' 'Constructeur'
e:\documents and settings\lili\bureau\vehicul.cpp(52) : error C2143: syntax error : missing ';' before '{'
e:\documents and settings\lili\bureau\vehicul.cpp(52) : error C2447: missing function header (old-style formal list?)
e:\documents and settings\lili\bureau\vehicul.cpp(79) : error C2143: syntax error : missing ';' before '*'
e:\documents and settings\lili\bureau\vehicul.cpp(79) : error C2501: 'Carross' : missing storage-class or type specifiers
e:\documents and settings\lili\bureau\vehicul.cpp(79) : error C2061: syntax error : identifier 'Carross'
e:\documents and settings\lili\bureau\vehicul.cpp(79) : error C2238: unexpected token(s) preceding ';'
e:\documents and settings\lili\bureau\vehicul.cpp(80) : error C2143: syntax error : missing ',' before '*'
e:\documents and settings\lili\bureau\vehicul.cpp(80) : error C2501: 'Moteur' : missing storage-class or type specifiers
e:\documents and settings\lili\bureau\vehicul.cpp(80) : error C2061: syntax error : identifier 'Moteur'
e:\documents and settings\lili\bureau\vehicul.cpp(105) : error C2143: syntax error : missing ';' before '}'
e:\documents and settings\lili\bureau\vehicul.cpp(105) : error C2143: syntax error : missing ';' before '}'
e:\documents and settings\lili\bureau\vehicul.cpp(105) : error C2143: syntax error : missing ';' before '}'
e:\documents and settings\lili\bureau\vehicul.cpp(105) : error C2143: syntax error : missing ';' before '}'
e:\documents and settings\lili\bureau\vehicul.cpp(105) : error C2143: syntax error : missing ';' before '}'
e:\documents and settings\lili\bureau\vehicul.cpp(105) : error C2143: syntax error : missing ';' before '}'
e:\documents and settings\lili\bureau\vehicul.cpp(105) : error C2143: syntax error : missing ';' before '}'
e:\documents and settings\lili\bureau\vehicul.cpp(105) : error C2143: syntax error : missing ';' before '}'
e:\documents and settings\lili\bureau\vehicul.cpp(105) : error C2143: syntax error : missing ';' before '}'
e:\documents and settings\lili\bureau\vehicul.cpp(105) : error C2143: syntax error : missing ';' before '}'
e:\documents and settings\lili\bureau\vehicul.cpp(105) : error C2143: syntax error : missing ';' before '}'
e:\documents and settings\lili\bureau\vehicul.cpp(105)  
 
 
 
 
 
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
 
           /////////////////////////////////
          ////// MES CLASSES //////////////
         /////////////////////////////////
 
 
 
 
 
class Vehicule  
{
 
 //Constructeur constructeur_veh;
 //Caroos caross_veh;
 //Moteur moteur_veh;
 //Taille taille_veh;
     
 string genre;
 
 string n_serie;
 
 int poids;
 
 int vitess_max;
 
    double prix;
 
public :
 
 Vehicule();
 Vehicule(string ,string, int, int , double);
 Vehicule(const Vehicule& objVeh);
     
 Vehicule operator +(const Vehicule & add);  
    Vehicule operator -(const Vehicule & sous);  
    int      operator==(const Vehicule & assin);  
 
 ~Vehicule();
 
    void setVeh();
       
 
}
 
////////////////////////////////////////////////////////////////
 
class Constructeur
 
{      
 Vehicule* vehicule_const = new Vehicule;
    Moteur* moteur_const = new Moteur;
 
     string marque;
  string ref;
  string n_chassi;
        string remarque_const;
 
public :
 
 Constructeur();
 Constructeur(string ,string, string, string );
 Constructeur(const Constructeur & objConst);
     
 Constructeur operator +(const Constructeur & add);  
    Constructeur operator -(const Constructeur & sous);  
    int          operator==(const Constructeur & assin);  
 
 ~Constructeur();
 
}  
 
////////////////////////////////////////////////////////////////
 
class Caracter
{  
 Carross* caros_caracter = new Carross;
    Moteur* moteur_caracter = new Moteur;
 
 string materio;
 
      int longue;
  int large;
  int haute;
 
         int r;
         int g;
         int b;
         string detaille_coul;
 
 
public :
 
 Caracter();
 Caracter(string ,int, int, int ,int ,int ,int ,string );
 Caracter(const Caracter & objCara);
     
 Caracter operator +(const Caracter & add);  
    Caracter operator -(const Caracter & sous);  
    int      operator==(const Caracter & assin);  
 
 ~Caracter();
}
 
 
////////////////////////////////////////////////////////////////
 
class carross
{
         
     Vehicule* vehicule_caross = new Vehicule;
  Caracter caracter_carross;
   
        int poids;
  int nb_porte;
  int nb_fenetre;
  int nb_place;
  int nb_roue;
  bool cabrio;
  bool toit_ouvr;
 
public :
 
 Carross();
 Carross(int ,int ,int ,int ,int ,bool ,bool );  
 Carross(const Carross & objCaros);
     
 Carross operator +(const Carross & add);  
    Carross operator -(const Carross & sous);  
    int     operator==(const Carross & assin);  
 
 ~Carross();
 
}
 
////////////////////////////////////////////////////////////////
 
class Moteur
{
 
 Vehicule vehicule_moteur;
 Taillle taille_moteur;
 
 string carburant;
 int puissance;
 int chevaux;
 int volume;
 int nb_vitesse;
 int acceleration;
 int consom_carbur;
 bool automatic;
 string detaille;
 
public :
 
 Moteur();
 Moteur(string ,int ,int ,int ,int ,int ,int ,bool ,string );
 Moteur(const Moteur & objMot);
     
 Moteur operator +(const Moteur & add);  
    Moteur operator -(const Moteur & sous);  
    int    operator==(const Moteur & assin);  
 
 ~Moteur();
 
 
 
 
}
 
 
           /////////////////////////////////
          /// CONSTRUCTEURS PAR DEFAUT ////
         /////////////////////////////////
 
 
Vehicule::Vehicule()
 
{
 
 
 genre="";
 
 n_serie=0;
 
 poids=0;
 
 vitess_max=0;
 
    prix=0.0;
}
 
////////////////////////////////////////////////////////////////
 
Constructeur::Constructeur()
{
     marque="";
  ref="";
  n_chassi=0;
        remarque_const="";
 
 
}
 
////////////////////////////////////////////////////////////////
 
Caracter::Caracter()
{
         materio="";
 
       longue=0;
   large=0;
   haute=0;
 
      r=0;
      g=0;
      b=0;
       
   detaille_coul="";
 
}
 
////////////////////////////////////////////////////////////////
 
Carross::Carross()
{
        poids=0;
  nb_porte=0;
  nb_fenetre=0;
  nb_place=0;
  nb_roue=0;
  cabrio=false;
  toit_ouvr=false;
 
 
}
 
////////////////////////////////////////////////////////////////
 
Moteur::Moteur()
{
 
  carburant="";
  puissance=0;
  chevaux=0;
  volume=0;
  nb_vitesse=0;
  acceleration=0;
  consom_carbur=0;
  automatic=false;
  detaille="";
 
}
 
 
 
 
           /////////////////////////////////
          // CONSTRUCTEURS INITIALISANTS //
         /////////////////////////////////
 
 
 
 
 
Vehicule::Vehicule(string a,string b,int c, int d,double e)
 
{
 
 
 genre=a;
 
 n_serie=b;
 
 poids=c;
 
 vitess_max=d;
 
 prix=e;
 
}
 
 
////////////////////////////////////////////////////////////////
 
Constructeur::Constructeur(string a,string b, string c, string d)
{
     marque=a;
  ref=b;
  n_chassi=c;
        remarque_const=d;
 
 
}
 
////////////////////////////////////////////////////////////////
 
Caracter::Caracter(string a,int b, int c, int d,int e,int f,int g,string h)
{
         materio=a;
 
       longue=b;
   large=c;
   haute=d;
 
      r=e;
      g=f;
      b=g;
       
   detaille_coul=h;
 
}
 
////////////////////////////////////////////////////////////////
 
Carross::Carross(int a,int b,int c,int d,int e,bool f,bool g)
{
        poids=a;
  nb_porte=b;
  nb_fenetre=c;
  nb_place=d;
  nb_roue=e;
  cabrio=f;
  toit_ouvr=g;
 
 
}
 
////////////////////////////////////////////////////////////////
 
Moteur::Moteur(string a,int b,int c,int d,int e,int f,int g,bool h,string e)
{
 
  carburant=a;
  puissance=b;
  chevaux=c;
  volume=d;
  nb_vitesse=e;
  acceleration=f;
  consom_carbur=g;
  automatic=h;
  detaille=e;
 
}
 
 
 
           /////////////////////////////////
          /// CONSTRUCTEURS PAR RECOPIE ///
         /////////////////////////////////
 
 
 
Vehicule::Vehicule(const Vehicule& objVeh)
{
 genre=objVeh.genre;
 
 n_serie=objVeh.n_serie;
 
 poids=objVeh.poids;
 
 vitess_max=objVeh.vitess_max;
 
 prix=objVeh.prix;
 
}
 
////////////////////////////////////////////////////////////////
 
Constructeur::Constructeur(const Constructeur & objConst);
{
     marque=objConst.marque;
  ref=objConst.ref;
  n_chassi=objConst.n_chassi;
        remarque_const=objConst.remarque_const;
 
 
}
 
////////////////////////////////////////////////////////////////
 
Caracter::Caracter(const Caracter & objCara);
{
         materio=objCara.materio;
 
       longue=objCara.longue;
   large=objCara.large;
   haute=objCara.haute;
 
      r=objCara.r;
      g=objCara.g;
      b=objCara.b;
       
   detaille_coul=objCara.detaille_coul;
 
}
 
////////////////////////////////////////////////////////////////
 
Carross::Carross(const Carross & objCaros);
 
{
        poids=objCaros.poids;
  nb_porte=objCaros.nb_porte;
  nb_fenetre=objCaros.nb_fenetre;
  nb_place=objCaros.nb_place;
  nb_roue=objCaros.nb_roue;
  cabrio=objCaros.cabrio;
  toit_ouvr=objCaros.toit_ouvr;
 
 
}
 
////////////////////////////////////////////////////////////////
 
Moteur::Moteur(const Moteur & objMot);
{
 
  carburant=objMot.carburant;
  puissance=objMot.puissance;
  chevaux=objMot.chevaux;
  volume=objMot.volume;
  nb_vitesse=objMot.nb_vitesse;
  acceleration=objMot.acceleration;
  consom_carbur=objMot.consom_carbur;
  automatic=objMot.automatic;
  detaille=objMot.detaille;
 
}
 
 
 
 
 
           /////////////////////////////////
          //// SURCHARGE D'OPERATEURS /////
         /////////////////////////////////
 
 
 
///// 1. CLASSE VEHICULE ////////////////////////////////////
 
 
Vehicule Vehicule::operator +(const Vehicule & add)
{
 
Vehicule veh;
 
    veh.genre = genre + add.genre;
 veh.n_serie = n_serie + add.n_serie;
 veh.poids = poids + add.poids;
    veh.vitess_max = vitess_max + add.vitess_max;
 veh.prix = prix + add.prix;
 
return veh;
 
}
 
////////////////////////////////////////////////////////////////
 
 
 
Vehicule Vehicule::operator -(const Vehicule & sous)  
   
{
 
Vehicule veh_;
 
    veh_.genre = genre - sous.genre;
 veh_.n_serie = n_serie - sous.n_serie;
 veh_.poids = poids - sous.poids;
 veh_.vitess_max = vitess_max - sous.vitess_max;
 veh_.prix = prix - sous.prix;
 
return veh_;
 
}
 
////////////////////////////////////////////////////////////////
 
 
int Vehicule::operator==(const Vehicule & assin)  
 
{
 if(  
   genre==assin.genre &&
      n_serie==assin.n_serie &&
      poids==assin.poids &&
      vitess_max==assin.vitess_max &&
      prix==assin.prix  
   
   )
 
return 1;
     
     else
 
return 0;
 
}
 
 
///// 2. CLASSE CONSTRUCTEUR //////////////////////////////////
 
 
Constructeur Constructeur::operator +(const Constructeur & add)  
 
{
Constructeur cons;
 
     cons.marque = marque + add.marque;
  cons.ref = ref + add.ref;
  cond.n_chassi = n_chassi + add.n_chassi;
        cons.remarque_const = remarque_const + add.remarque_const;
 
return cons;
 
}
 
 
////////////////////////////////////////////////////////////////
 
 
 
Constructeur Constructeur::operator -(const Constructeur & sous)
 
{
Constructeur cons_;
 
     cons_.marque = marque - sous.marque;
  cons_.ref = ref - sous.ref;
  cond_.n_chassi = n_chassi - sous.n_chassi;
        cons_.remarque_const = remarque_const - sous.remarque_const;
 
return cons_;
 
}
 
     
////////////////////////////////////////////////////////////////
 
 
 
int Constructeur::operator==(const Constructeur & assin)  
 
{
 if (    marque == assin.marque &&
      ref == assin.ref &&
      n_chassi == assin.n_chassi &&
            remarque_const == assin.remarque_const  
  )
 
return 1;
 else
return 0;
 
}
 
 
 
///// 3. CLASSE CARACTER ///////////////////////////////////////
 
 
Caracter Caracter::operator +(const Caracter & add);
 
{
Caracter car;
 
         car.materio = materio + add.materio;
 
       car.longue = longue + add.longue;
   car.large = large + add.large;
   car.haute = haute + add.haute;
 
      car.r = r + add.r;
      car.g = g + add.g;
      car.b = b + add.b;
       
   car.detaille_coul = detaille_coul + add.detaille_coul;
 
return car;
}
 
 
////////////////////////////////////////////////////////////////
 
Caracter Caracter::operator -(const Caracter & sous)
 
Caracter car_;
 
         car_.materio = materio - sous.materio;
 
       car_.longue = longue - sous.longue;
   car_.large = large - sous.large;
   car_.haute = haute - sous.haute;
 
      car_.r = r - sous.r;
      car_.g = g - sous.g;
      car_.b = b - sous.b;
       
   car_.detaille_coul = detaille_coul - sous.detaille_coul;
 
return car_;
}
 
 
////////////////////////////////////////////////////////////////
 
 
int Caracter::operator==(const Caracter & assin)
 
{
 if(
   materio == assin.materio &&
 
       longue == assin.longue &&
   large == assin.large &&
   haute == assin.haute &&
 
      r == assin.r &&
      g == assin.g &&
      b == assin.b &&
       
   detaille_coul == assin.detaille_coul
   )
 
return 1;
 else
return 0;
 
}
 
 
 
///// 4. CLASSE CARROSS ////////////////////////////////////////
 
 
 
Carross operator +(const Carross & add);  
 
 
{
Carross crs;
 
     crs.poids = poids + add.poids;
  crs.nb_porte = nb_porte + add.nb_porte;
  crs.nb_fenetre = nb_fenetre + add.nb_fenetre;
  crs.nb_place = nb_place + add.nb_place;
  crs.nb_roue = nb_roue + add.nb_roue;
   
  //crs.cabrio = cabrio && add.cabrio;
  //crs.toit_ouvr = toit_ouvr && add.toit_ouvr;
 
return crs;  
}
 
////////////////////////////////////////////////////////////////
 
 
Carross Carross::operator -(const Carross & sous)
 
{
Carross crs_;
 
     crs_.poids = poids - sous.poids;
  crs_.nb_porte = nb_porte - sous.nb_porte;
  crs_.nb_fenetre = nb_fenetre - sous.nb_fenetre;
  crs_.nb_place = nb_place - sous.nb_place;
  crs_.nb_roue = nb_roue - sous.nb_roue;
   
  //crs_.cabrio = cabrio && sous.cabrio;
  //crs_.toit_ouvr = toit_ouvr && sous.toit_ouvr;
 
return crs;  
}
 
////////////////////////////////////////////////////////////////
 
int Carrss::operator==(const Carross & assin);  
 
{
 if (
        poids == assin.poids &&
  nb_porte == assin.nb_porte &&
  nb_fenetre == assin.nb_fenetre &&
  nb_place == assin.nb_place &&
  nb_roue == assin.nb_roue &&
  cabrio == assin.cabrio &&
  toit_ouvr == assin.toit_ouvr
        )
 
return 1;
 else
return 0;
 
}  
 
 
///// 5. CLASSE MOTEUR  ////////////////////////////////////////
 
 
 
Moteur Moteur::operator +(const Moteur & add)
 
{
Moteur mot;
 
  mot.carburant = carburant + add.carburant;
  mot.puissance = puissance + add.puissance;
  mot.chevaux = chevaux + add.chevaux;
  mot.volume = volume + add.volume;
  mot.nb_vitesse = nb_vitess + add.nb_vitesse;
  mot.acceleration = acceleration + add.acceleration;
  mot.consom_carbur = consom_carbur + add.consom_carbur;
  //mot.automatic = automatic + add.automatic;
  mot.detaille = detaille + add.detaille;
 
return mot;
 
}
 
     
////////////////////////////////////////////////////////////////
 
 
 
Moteur Moteur::operator -(const Moteur & sous)
 
 
{
 
Moteur mot_;
 
  mot_.carburant = carburant - sous.carburant;
  mot_.puissance = puissance - sous.puissance;
  mot_.chevaux = chevaux - sous.chevaux;
  mot_.volume = volume - sous.volume;
  mot_.nb_vitesse = nb_vitess - sous.nb_vitesse;
  mot_.acceleration = acceleration - sous.acceleration;
  mot_.consom_carbur = consom_carbur - sous.consom_carbur;
  //mot_.automatic = automatic - sous.automatic;
  mot_.detaille = detaille - sous.detaille;
 
return mot_;
 
}
 
////////////////////////////////////////////////////////////////
     
 
int Moteur operator==(const Moteur & assin);  
 
{
 
 if (
        carburant == assin.carburant &&
        puissance == assin.puissance &&
        chevaux == assin.chevaux &&
        volume == assin.volume &&
        nb_vitesse == assin.nb_vitesse &&
        acceleration == assin.acceleration &&
        consom_carbur == assin.consom_carbur &&
        automatic == assin.automatic &&
        detaille == assin.detaille  
         )
 
return 1;
 else
return 0;
 
}
 
 
////////////////////////////////////////////////////////////////
 
 
 
 
 
           /////////////////////////////////
          ////////// FONCTIONS ////////////
         /////////////////////////////////
 
 
 
 
void setVeh();
 {
 
 
   cin >> genre ;
 
 cin >> n_serie ;
 
    cin >> poids;
 
 cin >> vitess_max;
 
 cin >> prix;
 
    cin >> constructeur_veh.marque;
 
 cin >> constructeur_veh.ref;
 
 cin >> constructeur_veh.n_chassi;
         
 cin >> constructeur_veh.remarque_const;
 
 cin >> caracter_carross.caross_veh.materio;
 
  cin >> caracter_carross.caross_veh.longue;
   
 cin >> caracter_carross.caross_veh.large;
   
 cin >> caracter_carross.caross_veh.haute;
 
 cin >> caracter_carross.caross_veh.r;
         
 cin >> caracter_carross.caross_veh.g;
         
 cin >> caracter_carross.caross_veh.b;
         
 cin >> caracter_carross.caross_veh.detaille_coul;
 
 
 }
 
void main (void)
 
{
 
return;
}

mood
Publicité
Posté le 02-10-2002 à 19:12:38  profilanswer
 

n°222892
koulip31
Posté le 02-10-2002 à 19:43:12  profilanswer
 

class
{
};

n°222896
NathalieCo​m
Posté le 02-10-2002 à 19:48:31  profilanswer
 

merci bcp


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  C++

  un devoir que j'arrive pas à le faire...aidez moi svp....merci

 

Sujets relatifs
Aidez moi à finaliser ma requête SQL !!![cours d'optimisation inside] Détournement de topic (merci phenix )
Log4j dans le cadre d'une web-app, j'arrive pas !DataReport, création d'un groupe... HELP! (Aidez moi SVP...)[Résolu]
SED insertion exemple SVP [ laissez tomber ] merci1er jour d'IUT 1er devoir d'algorithmik :lol:
[PHP] J'arrive pas à enlever les " \ " devant les caractères spéciauxSpecialiste de W-Agora : aidez-moi a faire un topic d'annonce !
php aidez moi svp !Un script qui fait bizzarre , pourriez vous regarder ca ??? merci
Plus de sujets relatifs à : un devoir que j'arrive pas à le faire...aidez moi svp....merci


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR