package geometrypack;
public class Calc {
public static double areaOfCircle(int radius) {
if (radius <= 0) {
System.out.println("Input cannot be a negative number.");
}
return (Math.PI * (radius * radius));
} // areaOfCircle method
public static double areaOfRectangle(int length,int width) {
if (length <= 0 || width <= 0) {
System.out.println("Input cannot be a negative number.");
}
return length * width;
} // areaOfRectangle method
public static double areaOfTriangle(int base, int height) {
if (base <= 0 || height <= …
Run Code Online (Sandbox Code Playgroud)