Apply the following formula to the area calculation inside the get Area method.
Area is equal to 0.5 * base * height; user input is requested for both triangles.
Check the areas of the two triangles and print the data for the bigger triangle.
/ / Triangle.java
Triangle public school
double base in private;
double height in private
Public void setBase(double base)
if this.base = base;
}void public setHeight(double height)
if this.height = height;
}
getArea() on a double is public.
recalculate 0.5 * base * height;
}
the public void printInfo()
System.out.printf ('Base:%.2f', 'base');
Height:%.2fn; System.out.printf("Height:%.2fn", height);
System.out.printf ("Area:%.2f", "getArea()")
}
}.
To learn more about Area of a triangle refer to:
https://brainly.com/question/17335144
#SPJ4