Richard_Sekol

excercise2

Sep 25th, 2014
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import java.awt.Rectangle;
  2. public class excercise2 {
  3.  
  4. public static void main(String[] args) {
  5. // TODO Auto-generated method stub
  6. Rectangle box = new Rectangle(100, 100, 50, 50);
  7. double width = box.getWidth();
  8. double height = box.getHeight();
  9. double perimeterRect = (2 * height) + (2 * width);
  10. System.out.println(perimeterRect);
  11.  
  12.  
  13.  
  14. }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment