Advertisement
fmbalvarez

Guía 5 - Ejercicio 6 - Círculo

Sep 26th, 2014
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1.  
  2. class Circulo {
  3.    
  4.     double radio;
  5.    
  6.     public Circulo (double radio){
  7.        
  8.         this.radio = radio;
  9.        
  10.     }
  11.    
  12.     public double getDiametro(){
  13.        
  14.         return (2*radio);
  15.        
  16.     }
  17.    
  18.     public double getRadio(){
  19.        
  20.         return (radio);
  21.        
  22.     }
  23.    
  24.     public double getPerimetro(){
  25.        
  26.         return (6.28*radio);
  27.        
  28.     }
  29.    
  30.     public double getSuperficie(){
  31.        
  32.         return((radio*radio)*3.14);
  33.        
  34.     }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement