Write a Java program that displays a table of square roots and cube roots. Use a loop to print the roots of numbers from 0 to 100, in increments of 5, as shown below. Output formatted columns with the number of decimal places as shown.
roots table
1
Expert's answer
2016-02-22T02:38:31-0500
public class Main {
public static void main(String[] args) {
System.out.println("square root cube root");
for (int i = 0; i < 101; i+=5) { System.out.printf("%03d = %07.4f %03d = %07.4f%n",i, Math.sqrt(i), i, Math.cbrt(i)); }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment