Guest User

Untitled

a guest
May 20th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.96 KB | None | 0 0
  1. Letter.java
  2. ------------------------------------------------------
  3. public class Letter {
  4.   public final double XHEIGHT = 6;
  5.   public final double DEFAULT_DEPTH = 0;
  6.   public String letter;
  7.   private double size;
  8.   public double height;
  9.   public double depth;
  10.  
  11.   public Letter( String inputLetter ) {
  12.     this.letter = inputLetter;
  13.     this.height = XHEIGHT;
  14.     this.depth = DEFAULT_DEPTH;
  15.   }
  16.  
  17.   public void setHeight( double newHeight ) {
  18.     this.height = newHeight;
  19.   }
  20.  
  21.   public void setDepth( double newDepth ) {
  22.     this.depth = newDepth;
  23.   }
  24.  
  25.   public void calculateSize( ) {
  26.     size = height + depth;
  27.   }
  28. }
  29. ----------------------------------
  30. lowerCase.java
  31. ----------------------------------
  32. public class lowerCase extends Letter {
  33.  
  34.   public lowerCase( String inputLetter ) {
  35.     inputLetter = inputLetter.toLowerCase( );
  36.     this.letter = inputLetter;
  37.     this.height = XHEIGHT;
  38.     this.depth = DEFAULT_DEPTH;
  39.   }
  40.  
  41. }
Add Comment
Please, Sign In to add comment