import java.util.Random;
public class RandomNumbers
{
public static void main(String[] args)
{
Random rand= new Random();
double low =Keyboard.readDouble("Enter the low limit for your random number(double)");
double high = Keyboard.readDouble("Enter the high limit for your random number(double)");
int low2 = Keyboard.readInt("Enter the high limit for your random number(int)");
int high2 = Keyboard.readInt("Enter the high limit for your random number(int)");
double x= randomDouble(rand, low, high);
int y= randomInt(rand, low2, high2);
System.out.println("Here is your random number(double): " + x);
System.out.println("Here is your random number(int): " + y);
}
public static double randomDouble(Random rand, int low, int high)
{
Random rand= new Random();
return ((high-low) * rand.nextDouble + low);
}
public static int randomInt(Random rand, int low2, int high2)
{
return rand.nextInt(high2 - low2 + 1) + low2;
}
}