Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.forge;
- public class Rectangulo implements Figura {
- double base;
- double altura;
- public Rectangulo(double base, double altura) {
- this.base = base;
- this.altura = altura;
- }
- public double area(){
- return base*altura;
- }
- public double perimetro(){
- return (base *2) +( altura*2);
- }
- public double getBase() {
- return base;
- }
- public void setBase(double base) {
- this.base = base;
- }
- public double getAltura() {
- return altura;
- }
- public void setAltura(double altura) {
- this.altura = altura;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement