Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] web/email now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as C by registered user raphael ( 1 year ago )
#include "geometrie.h"
#include <cmath>
#include <iostream>
#include <stdio.h>

using namespace std;

Geometrie::Geometrie()
{

}

void Geometrie::createCercle(int rayon){
    this->maforme = cercle;
    this->rayon = rayon;  // Initialisation du rayon
}

int Geometrie::aire(){
    int result = 0;
    if(this->maforme == cercle){
        result = M_PI * rayon * rayon;  // Utilisation du rayon
    }
    return result;
}

void Geometrie::toString(){
    if(this->maforme==cercle){
        cout<<"Cet objet geometrie est un cercle de rayon : "<<this->aire()<<endl;
    }
}

 

Revise this Paste

Your Name: Code Language: