991Fermer993
GodzilLe 19/10/2005 à 10:59
#include <iostream>
#include "rectangle.h"
#include "disque.h"
#include "carre.h"
#include "parall.h"

using namespace std;

int main ()
{
// test de la classe rectangle
rectangle r(2, 3);
r.doubler();
r.doubler(true, false);
cout << "rectangle : largeur = " << r.largeur() << endl;
cout << "rectangle : hauteur = " << r.hauteur() << endl;
cout << "rectangle : perimetre = " << r.perimetre() << endl;
cout << "rectangle : surface = " << r.surface() << endl << endl;

// test de la classe disque
disque d(3);
d.doubler();
cout << "disque : diametre = " << d.diametre() << endl;
cout << "disque : rayon = " << d.rayon() << endl;
cout << "disque : perimetre = " << d.perimetre() << endl;
cout << "disque : surface = " << d.surface() << endl << endl;

// test de la classe carre
carre c(3);
cout << "carre : cote = " << c.cote() << endl;
cout << "carre : perimetre = " << c.perimetre() << endl;
cout << "carre : surface = " << c.surface() << endl << endl;

// test de la classe parallelepipede
parallelepipede p(2, 4, 3);
cout << "parallelepipede : largeur = " << p.largeur() << endl;
cout << "parallelepipede : hauteur = " << p.hauteur() << endl;
cout << "parallelepipede : profondeur = " << p.profondeur() << endl;
cout << "parallelepipede : perimetre = " << p.perimetre() << endl;
cout << "parallelepipede : volume = " << p.volume() << endl;

return 0;
}