Advertisement
JVFabia

Untitled

Jul 15th, 2020
260
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.65 KB | None | 0 0
  1. package org.forge;
  2.  
  3. public class Rectangulo implements Figura {
  4.  
  5.     double base;
  6.     double altura;
  7.  
  8.     public Rectangulo(double base, double altura) {
  9.         this.base = base;
  10.         this.altura = altura;
  11.     }
  12.  
  13.     public double area(){
  14.        return base*altura;
  15.     }
  16.  
  17.     public double perimetro(){
  18.         return (base *2) +( altura*2);
  19.     }
  20.  
  21.     public double getBase() {
  22.         return base;
  23.     }
  24.  
  25.     public void setBase(double base) {
  26.         this.base = base;
  27.     }
  28.  
  29.     public double getAltura() {
  30.         return altura;
  31.     }
  32.  
  33.     public void setAltura(double altura) {
  34.         this.altura = altura;
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement