求java rewrite this method of the exemple so that it avoids the use of a return statementpublic static void printRoot(){Stdout.println("Please give a non-negative value");double x = Stdin.readDouble();if( x

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/08 20:40:25
求java rewrite this method of the exemple so that it avoids the use of a return statementpublic static void printRoot(){Stdout.println(

求java rewrite this method of the exemple so that it avoids the use of a return statementpublic static void printRoot(){Stdout.println("Please give a non-negative value");double x = Stdin.readDouble();if( x
求java rewrite this method of the exemple so that it avoids the use of a return statement
public static void printRoot()
{
Stdout.println("Please give a non-negative value");
double x = Stdin.readDouble();
if( x

求java rewrite this method of the exemple so that it avoids the use of a return statementpublic static void printRoot(){Stdout.println("Please give a non-negative value");double x = Stdin.readDouble();if( x
public static void printRoot()
{
Stdout.println("Please give a non-negative value");
double x = Stdin.readDouble();
if( x>=0)
Stdout.println("Square root is " + Math.sqrt(x));
}