Answer to Question #61741 in Java | JSP | JSF for Bill DeShields

Question #61741
Write a program that generates a table showing the sine, cosine, and tangent for angles from 0 to 90 degrees. Each line in the table should increment the angle by 5 degrees. Include column headings.
1
Expert's answer
2016-09-07T09:19:03-0400

public class Main {
public static void main(String[] args) {
System.out.println("Angle\t\t\tSin\t\t Cos\t\tTan");
for(int i = 0; i <= 90; i+=5){
System.out.printf("%-10d%10.2f%10.2f%10.2f\n", i,Math.sin(i),Math.cos(i),Math.tan(i));
}
}
}

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS