Binary Search to Compute Square root (Java)
I need help writing a program that uses binary search to recursively compute a square root (rounded down to the nearest integer) of an input non-negative integer. This is what I have so far: import java.util.Scanner; public class Sqrt { public static void main(String[] args) { Scanner console = new Scanner(System.in); System.out.print("Enter A Valid Integer: "); int value = console.nextInt(); calculateSquareRoot(value); } public static int calculateSquareRoot(int value) { while (value > 0) { double sqrt = (int) Math.sqrt(value); System.out.println(sqrt); } return -1; } } The fact that it has