micher43

Testing E2.2

Sep 25th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.32 KB | None | 0 0
  1. import java.awt.Rectangle;
  2.  
  3. public class PerimeterTester {
  4.  
  5.     public static void main(String[] args) {
  6.         Rectangle example = new Rectangle(23, 45, 23, 17);
  7.         double width = example.getWidth();
  8.         double height = example.getHeight();
  9.         double perimeter = 2*width + 2*height;
  10.         System.out.print(perimeter);
  11.        
  12.     }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment