作业帮 > 综合 > 作业

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

来源:学生作业帮 编辑:大师作文网作业帮 分类:综合作业 时间:2024/11/17 03:22:55
求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));
}