public static int getInteger() throws BadInput {
        int num;
        try {
            String str = getString();
            num = Integer.parseInt(str);
        } catch(NumberFormatException e) {
            throw new BadInput();
        }
        
        return num;
    }