public static int getInt(Scanner sc,String Prompt)
    {
        int i =0;
        boolean isValid= false;
        
        while(isValid==false)
        {
         System.out.print(Prompt);
         if(sc.hasNextInt())
         {
         i =sc.nextInt();
         isValid = true;
        }
        
        else
         {
        System.out.println("Error! Invalid decimal value. Try again.");
         }
         sc.nextLine();
       }

      return i;
    
    }