Created
February 24, 2009 23:51
-
-
Save antoniopassos/69882 to your computer and use it in GitHub Desktop.
Código-fonte do aplicativo AppDemoJeliot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Prog1Tools.IOTools; | |
import jeliot.io.*; | |
public class AppDemoJeliot { | |
public static void main(String args[]){ | |
System.out.print("Digite o valor do lado A: "); | |
int ladoA = Input.readInt(); | |
System.out.print("Digite o valor do lado B: "); | |
int ladoB = Input.readInt(); | |
Retangulo retangulo = new Retangulo(ladoA, ladoB); | |
System.out.println("Área do retangulo: " + retangulo.getArea()); | |
} | |
} | |
public class Retangulo { | |
private int ladoA; | |
private int ladoB; | |
public Retangulo() { | |
} | |
public Retangulo(int ladoA, int ladoB) { | |
this.ladoA = ladoA; | |
this.ladoB = ladoB; | |
} | |
public void setLadoA(int ladoA) { | |
this.ladoA = ladoA; | |
} | |
public int getLadoA() { | |
return this.ladoA; | |
} | |
public void setLadoB(int ladoB) { | |
this.ladoB = ladoB; | |
} | |
public int getLadoB() { | |
return this.ladoB; | |
} | |
public int getArea() { | |
return this.ladoA * this.ladoB; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment