Advertisement
lamdaman101

Area

Sep 13th, 2014
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1.  
  2. /**
  3. * Write a description of class Area here.
  4. *
  5. * @author (Lam Pham)
  6. * @version (9/13/14)
  7. */
  8. public class Area
  9. {
  10. static int radius;
  11. static double circleArea;
  12. public static void calculateArea()
  13. {
  14. System.out.println("Calculating areas of Area class");
  15. System.out.println("By: " + "Lam Pham");
  16. calculateCircle();
  17. System.out.println(circleArea);
  18. }
  19.  
  20. public void Area(int radius)
  21. {
  22. this.radius = radius;
  23. }
  24.  
  25. public static double calculateCircle()
  26. {
  27.  
  28. circleArea = 3.14 * radius * radius;
  29. return circleArea;
  30. }
  31.  
  32. public static void main(String [] args)
  33. {
  34. calculateArea();
  35. calculateCircle();
  36. System.out.println(circleArea);
  37. }
  38.  
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement