作业帮 > 综合 > 作业

求java rewrite this method of the exemple so that it avoids t

来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/10/03 02:27:51
求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 t
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));
}