Advertisement
aperles

preuba_vasos

Oct 5th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include "vasos.h"
  2.  
  3. int main (void)
  4.  
  5. {
  6.  
  7.  
  8.     TVaso vestatico1(10.0), vestatico2(20.0);
  9.     TVaso *p;
  10.  
  11.     p = new TVaso(30.0);
  12.  
  13.     vestatico1.EcharLiquido(5.0);
  14.     vestatico1.Beber(2.0);
  15.     printf("Aun queda %lf\n",vestatico1.VerCuantoQueda());
  16.    
  17.     vestatico2.EcharLiquido(8.0);
  18.     vestatico2.Beber(3.0);
  19.     printf("Aun queda %lf\n",vestatico2.VerCuantoQueda());
  20.  
  21.     p->EcharLiquido(16.0);
  22.     p->Beber(6.0);
  23.     printf("Aun queda %lf\n",p->VerCuantoQueda());
  24.  
  25. }
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement