// // Loop1.java // // Read a positive and calculate its cubic root // Math.pow(x, 1.0/3.0) import java.util.Scanner; public class Loop1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Input a positive (-1 to quit): "); double x = input.nextDouble(); while(x > 0) { double answer = Math.pow(x, 1.0/3.0); System.out.println("The answer is: " + answer); System.out.print("Input a positive (-1 to quit): "); x = input.nextDouble(); } } }