public static double getDouble(Scanner sc, String Prompt)
    {
        double d =0;
        boolean isValid = false;
        
        while(isValid==false)
        {
            System.out.print(Prompt);
            if (sc.hasNextDouble())
            {
            d=sc.nextDouble();
            isValid=true;
            }
            
            else
            {
            System.out.println("Error! Invalid decimal value. Try again.");
            }
            sc.nextLine(); //Discard any other data entered on the line
        }
        
        return d;
   
    }