public String getInput() {

        String newName = null;
        Scanner in = new Scanner(System.in);
                
        boolean valid = false; // flag to indicate if valid character entered
        while (!valid) {
            
            // get input from user           
            newName = in.nextLine();
           
            // no Name entered?
            if (newName == null  || newName.length() < 1) {
                continue;
            }
            
            //convert name to uppercaase
            newName = newName.toUpperCase();
            
            if (newName.equals("Q")) { // Quit?
                return null;
            }
            
            // Check to see if name is between 3 and 12 charcters. 
           try {
            if (newName.length() < 3) {
               throw new PlayerException (ErrorType.Error301.getMessage());
            
            }
           } catch (PlayerException ex) {
               ErrorType.displayErrorMsg(ex.getMessage());
               continue;
           } 
           
           try {
            if (newName.length() > 12) {
              throw new PlayerException (ErrorType.Error302.getMessage());
   
            }
           } catch (PlayerException ex){
               ErrorType.displayErrorMsg(ex.getMessage());
               continue;
               
           }
            valid = true; // signal that a valid token was entered
        }
        
        return newName;
        }