Skip to content

Instantly share code, notes, and snippets.

@antoniopassos
Created February 24, 2009 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antoniopassos/69882 to your computer and use it in GitHub Desktop.
Save antoniopassos/69882 to your computer and use it in GitHub Desktop.
Código-fonte do aplicativo AppDemoJeliot
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