Answer:
The program in Java is as follows:
import java.util.*;
import java.lang.Math;
public class Rooter{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int start;
System.out.print("Start: ");
start = input.nextInt();
while(start<=0){
System.out.print("Number must be positive\nStart: ");
start = input.nextInt(); }
while(start>=0){
System.out.println(Math.sqrt(start));
start--; }
}
}
Explanation:
This declares start as integer
int start;
This prompts the user for input
System.out.print("Start: ");
This gets input for start
start = input.nextInt();
The following is repeated until the user input is valid i.e. positive
<em> while(start<=0){</em>
<em> System.out.print("Number must be positive\nStart: ");</em>
<em> start = input.nextInt(); }</em>
The following while loop prints the square root of each number till 0
<em> while(start>=0){</em>
<em> System.out.println(Math.sqrt(start));</em>
<em> start--; }</em>