public class JavaTracingMethodsDemo2 { public static void main(String[] args) { System.out.println(10 * 10); System.out.println(computeAreaSquare(10)); System.out.println(computePerimeterSquare(5)); System.out.println(computeAreaTriangle(5, 8)); System.out.println(computeAreaRectangle(10, 4)); System.out.println(computeAreaRectangleV2(10, 4)); int len = 6; int wid = 8; System.out.println(computeAreaRectangle(len, wid)); System.out.println(computeAreaRectangle(len + 1, wid * 2)); }// end of main //////////////////////////////////////////////// public static int computeAreaSquare(int width) { return width * width; }// end of computeAreaSquare //////////////////////////////////////////////// public static int computePerimeterSquare(int width) { return 4 * width; }// end of computePerimeterSquare //////////////////////////////////////////////// public static double computeAreaTriangle(int base, int height) { return (base * height) / 2.0; }// end of computeAreaTriangle //////////////////////////////////////////////// public static int computeAreaRectangle(int length, int width) { return length * width; }// end of computeAreaRectangle //////////////////////////////////////////////// public static int computeAreaRectangleV2(int length, int width) { int result = 0; result = length * width; return result; }// end of computeAreaRectangleV2 }