Advertisement
aperles

preuba_vasos

Oct 5th, 2011
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.71 KB | None | 0 0
  1. #include "vasos.h"
  2.  
  3. #include <stdio.h>
  4.  
  5.  
  6.  
  7.  
  8. int main (void)
  9.  
  10.  
  11.  
  12. {
  13.  
  14.  
  15.  
  16.  
  17.  
  18.     TVaso vestatico1(10.0), vestatico2(20.0);
  19.  
  20.     TVaso *p,*p2;
  21.  
  22.  
  23.  
  24.     p = new TVaso(30.0);
  25.  
  26.  
  27.  
  28.     vestatico1.EcharLiquido(5.0);
  29.  
  30.     vestatico1.Beber(2.0);
  31.  
  32.     printf("Aun queda %lf\n",vestatico1.VerCuantoQueda());
  33.  
  34.    
  35.  
  36.     vestatico2.EcharLiquido(8.0);
  37.  
  38.     vestatico2.Beber(3.0);
  39.  
  40.     printf("Aun queda %lf\n",vestatico2.VerCuantoQueda());
  41.  
  42.  
  43.  
  44.     p->EcharLiquido(16.0);
  45.  
  46.     p->Beber(6.0);
  47.  
  48.     printf("Aun queda %lf\n",p->VerCuantoQueda());
  49.  
  50.     p2 = new TVaso(100.0);
  51.  
  52.     p2->EcharLiquido(150.0);
  53.  
  54.     p2->Beber(60.0);
  55.     p2->EcharLiquido(10.0);
  56.  
  57.     p2->Beber(20.0);
  58.  
  59.  
  60.  
  61.     printf("Aun queda %lf\n",p2->VerCuantoQueda());
  62.  
  63.  
  64. }
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement