You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

21 lines
822 B

public class ExerciseRunner {
public static void main(String[] args) {
AreaCalculator calculator = new AreaCalculator();
// Test calculate area of a circle
double circleArea = calculator.calculate(5.0);
System.out.println("Area of circle: " + circleArea);
// Test calculate area of a rectangle
double rectangleArea = calculator.calculate(4.0, 6.0);
System.out.println("Area of rectangle: " + rectangleArea);
// Test calculate area of a triangle
double triangleArea = calculator.calculate(4.0, 6.0, true);
System.out.println("Area of triangle: " + triangleArea);
// Test calculate area of a square
double squareArea = calculator.calculate(4.0, true);
System.out.println("Area of square: " + squareArea);
}
}