# Answer to Question #57614 in Java | JSP | JSF for Kenya

Question #57614

. 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.

Expert's answer

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);

}

}

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 orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment