Advertisement
fmbalvarez

Guía 5 - Ejercicio 4 - Cubo

Sep 26th, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.39 KB | None | 0 0
  1.  
  2. class Cubo {
  3.    
  4.     int lado;
  5.    
  6.     public Cubo(int lado){
  7.        
  8.         this.lado = lado;
  9.        
  10.     }
  11.    
  12.     public int obtenerLado(){
  13.        
  14.         return (lado);
  15.        
  16.     }
  17.    
  18.     public void setLongitudLado(int lado){
  19.        
  20.         if (lado > 0){
  21.            
  22.             this.lado = lado;
  23.         }
  24.     }
  25.    
  26.     public int getSuperficieCara(){
  27.        
  28.         return (lado*4);
  29.        
  30.     }
  31.    
  32.     public int getVolumen(){
  33.        
  34.         return (lado^lado*lado);
  35.        
  36.     }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement