public static double getDouble() throws BadInput {
        double num;
        try {
            String str = getString();
            num = Double.parseDouble(str);
        } catch(NumberFormatException e) {
            throw new BadInput();
        }
        return num;
    }