Advertisement
RazorBlade57

Rectangle

Oct 13th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. //Β© A+ Computer Science  -  www.apluscompsci.com
  2. //Name - Chris Clemente
  3. //Date - 10-13-2016
  4. //Class - Comp Sci
  5. //Lab  -
  6.  
  7. public class Rectangle
  8. {
  9.     private int length;
  10.     private int width;
  11.     private int perimeter;
  12.  
  13.     public void setLengthWidth(int len, int wid )
  14.     {
  15.         length=len;
  16.         width=wid;
  17.     }
  18.  
  19.     public void calculatePerimeter( )
  20.     {
  21.         perimeter=((2 * length) + (2 * width));
  22.     }
  23.  
  24.     public void print( )
  25.     {
  26.         System.out.println("The perimeter is :: " + perimeter);
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement