Advertisement
aperles

implementacion TVaso

Oct 5th, 2011
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <vasos.h>
  2.  
  3. void TVaso::TVaso(double capacidad){
  4.     capacidad_vaso=capacidad;
  5.     cantidad_liquido=0;
  6. }
  7.  
  8. void TVaso::EcharLiquido(double valor){
  9.     cantidad_liquido+=valor;
  10.     if(cantidad_liquido > capacidad_vaso){
  11.         cantidad_liquido=0;
  12.     }
  13. }
  14.  
  15. void TVaso::Beber(double valor){
  16.     cantidad_liquido-=valor;
  17. }
  18.  
  19. double TVaso::VerCuantoQueda(void) {
  20.     return cantidad_liquido;
  21. }
  22.  
  23.  
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement