Advertisement
lucast0rres

Lab3_Ponto&Interface

Apr 13th, 2017
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.94 KB | None | 0 0
  1. /**
  2.  * @author Lucas Pereira Torres de Araújo, 384364
  3.  * Universidade Federal do Ceará - Tecnicas de Programacao I, 2017.1
  4.  */
  5.  
  6. public class Ponto {
  7.     float px;
  8.     float py;
  9.    
  10.     Ponto(float x, float y) {
  11.         this.px = x;
  12.         this.py = y;
  13.     }
  14.    
  15.     void moverPonto(float dx, float dy) {
  16.         this.px += dx;
  17.         this.py += dy;
  18.     }
  19.    
  20.     String imprimirPonto() {
  21.         return "("+this.px+", "+this.py+")";
  22.     }
  23.    
  24. }
  25.  
  26. /**
  27.  * @author Lucas Pereira Torres de Araújo, 384364
  28.  * Universidade Federal do Ceará - Tecnicas de Programacao I, 2017.1
  29.  */
  30.  
  31. public interface Figura {
  32.     void mover(float dx, float dy);
  33.     double calcularArea();
  34.     String desenhar();
  35. }
  36.  
  37. /**
  38.  * @author Lucas Pereira Torres de Araújo, 384364
  39.  * Universidade Federal do Ceará - Tecnicas de Programacao I, 2017.1
  40.  */
  41.  
  42. public interface Colorida {
  43.     String desenhar(String cor);
  44.     void setCor(String cor);
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement