Hi, I am new to Java, and have been trying to write a program that calculates the square root of a number using the Babylonian/Heron method. I have been able to make it work, largely due to a lot of help from a PhD student.
So yeah, what I'm trying to do now is to create a do-while loop so that a user chooses whether they want to exit the program or not.
So far i've got
System.out.println("Press y to continue using the program or any other character to exit");
s = stdin.read();
System.out.println( );
}
while (s = "y"){
Where s is the variable name of whatever the user's response is. I want to say if the user presses y, for the whole program to run again, and if they don't, for the program to terminate.
All help is appreciated, thanks guys.
P.S. the relevant java class files are attached.