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.
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!
Learn more about our help with Assignments:
JavaJSPJSF