Advertisement
Guest User

ShapeUtilities.java

a guest
Mar 31st, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. package shapes;
  2.  
  3. public class ShapeUtilities
  4. {
  5.     public static double getRectangleArea(double w, double h) {
  6.         return w * h;
  7.     }
  8.  
  9.     public static double getRectanglePerimeter(double w, double h) {
  10.         return w * 2 +  h * 2;
  11.     }
  12.  
  13.     public static double getCircleArea(double rad) {
  14.         return Math.PI * rad * rad;
  15.     }
  16.    
  17.     public static double getCircleCircumference(double rad) {
  18.         return 2 * Math.PI * rad;
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement