Guest User

Untitled

a guest
Jan 22nd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1. //
  2. //  main.cpp
  3. //  Figura
  4. //
  5. //  Created by Marco Antonio Lopez Rodriguez on 15/10/12.
  6. //  Copyright (c) 2012 Marco Antonio Lopez Rodriguez. All rights reserved.
  7. //
  8.  
  9. #include <iostream>
  10. #include "Cilindro.h"
  11. #include "Cubo.h"
  12. #include "Punto.h"
  13. using namespace std;
  14.  
  15. int main(int argc, const char * argv[])
  16. {
  17.    
  18.  
  19.     Figura *fig;
  20.    
  21.     Punto p1(2,3);
  22.     fig=&p1;
  23.     cout<<fig->Shapename()<<endl;
  24.     cout<<p1<<endl;
  25.    
  26.     circulo circulo1(2,3,4);
  27.     fig = &circulo1;
  28.     cout<<fig->Shapename()<<" Mi Area es: "<<fig->Area()<<endl;
  29.     cout<<circulo1<<endl;
  30.    
  31.     Rectangulo rectangulo1(2,3,4,5);
  32.    
  33.     fig = &rectangulo1;
  34.     cout<<fig->Shapename()<<" Mi Area es: "<<fig->Area()<<endl;
  35.     cout<<rectangulo1<<endl;
  36.  
  37.    
  38.     cilindro cilindro1(2,3,4,5);
  39.     fig = &cilindro1;
  40.     cout<<fig->Shapename()<<" Mi Area es: "<<fig->Area()<<"Y mi volumen "<<fig->Volumen()<<endl;
  41.     cout<<cilindro1<<endl;
  42.  
  43.          
  44.     Cubo cubo1(2,3,4,5,6);
  45.     fig = &cubo1;
  46.     cout<<fig->Shapename()<<" Mi Area es: "<<fig->Area()<<"Y mi volumen "<<fig->Volumen()<<endl;
  47.     cout<<cubo1<<endl;
  48.    
  49.    
  50.    
  51.    
  52.    
  53.  
  54.     return 0;
  55.    
  56.    
  57. }
Add Comment
Please, Sign In to add comment