|
I'm taking this as a class but i'm stuck
import java.util.*;
public class Sort3 {
public static Scanner in = new Scanner (System.in);
public static void main (String [] args) {
System.out.println (GetDouble());
double a = GetDouble();
double b = GetDouble();
double c = GetDouble();
}
public static double GetDouble() {
System.out.print ("Enter a double: ");
double x = GetDouble ();
return x;
}
}
When i run this it prints out "Enter a double:" hundreds of times and a dont know y. I need to be able to have GetDouble Ask 3 sperate times so i can get a,b, and c. ???
Also on a side note how would i check to make sure they entered a valid double??
|
|
|
|
|
|
|
|