. In right triangle ABC below, angle C is 90 degrees, b = 8, and c = 10. Write a Java program that calculates side a, angle A, and angle B. Express all measures accurate to three decimal places.
public class Triangle {
public static void main(String[] args) {
double angleC = 90;
double b = 8;
double c = 10;
double angleA, angleB, a;
a = Math.sqrt((c * c) - (b * b));
angleA = Math.toDegrees(Math.asin(a / c));
angleB = angleC - angleA;
System.out.printf("Side a = %.3f \n", a);
System.out.printf("Angle A = %.3f \n", angleA);
System.out.printf("Angle B = %.3f \n", angleB);
}
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
JavaJSPJSF