Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // main.cpp
- // Figura
- //
- // Created by Marco Antonio Lopez Rodriguez on 15/10/12.
- // Copyright (c) 2012 Marco Antonio Lopez Rodriguez. All rights reserved.
- //
- #include <iostream>
- #include "Cilindro.h"
- #include "Cubo.h"
- #include "Punto.h"
- using namespace std;
- int main(int argc, const char * argv[])
- {
- Figura *fig;
- Punto p1(2,3);
- fig=&p1;
- cout<<fig->Shapename()<<endl;
- cout<<p1<<endl;
- circulo circulo1(2,3,4);
- fig = &circulo1;
- cout<<fig->Shapename()<<" Mi Area es: "<<fig->Area()<<endl;
- cout<<circulo1<<endl;
- Rectangulo rectangulo1(2,3,4,5);
- fig = &rectangulo1;
- cout<<fig->Shapename()<<" Mi Area es: "<<fig->Area()<<endl;
- cout<<rectangulo1<<endl;
- cilindro cilindro1(2,3,4,5);
- fig = &cilindro1;
- cout<<fig->Shapename()<<" Mi Area es: "<<fig->Area()<<"Y mi volumen "<<fig->Volumen()<<endl;
- cout<<cilindro1<<endl;
- Cubo cubo1(2,3,4,5,6);
- fig = &cubo1;
- cout<<fig->Shapename()<<" Mi Area es: "<<fig->Area()<<"Y mi volumen "<<fig->Volumen()<<endl;
- cout<<cubo1<<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment