Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Java application that prints the following table using the sqrt ( ) meth

ID: 3622974 • Letter: W

Question

Write a Java application that prints the following table using the sqrt ( ) method in the Math class. Use a for loop to produce the output results. Compile and run your program until it works and the output looks nice. Add the necessary documentation as described in Course Documents, and then attach your .java file to this assignment. Do not attach the .class file, attach only the .java source code.

Number SquareRoot
0 0.0000
2 1.4142
4 2.0000
6 2.4495
8 2.8284
10 3.1623
12 3.4641
14 3.7417
16 4.0000
18 4.2426
20 4.4721

Explanation / Answer

please rate - thanks

public class table {
public static void main(String[] args)
{
int i;
System.out.println("Number SquareRoot");
for(i=0;i<=20;i+=2)
     System.out.printf("%2d %.4f ",i,Math.sqrt(i));
}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote