Printing a number based on a user-provided number
The best way to shorten the code would be to write a formula for it.  That formula should be packaged into a function:

public static String outputForDay(int day) {
    if (!(1 &lt;= day &amp;&amp; day &lt;= 31)) {
        throw new IllegalArgumentException("Invalid entry for the day.");
    }
    int onesDigit = day % 10,
        tensDigit = day / 10;
    return Integer.toString(10 * (tensDigit + 1) + (onesDigit % 4) + 1);
}


Then, you would call the function like this:

public static void main(String[] args) {
    try (Scanner scanner = new Scanner(System.in)) {
        System.out.print("Enter the day of the month: ");
        System.out.println(outputForDay(scanner.nextInt()));
    } catch (IllegalArgumentException e) {
        System.out.println(e.getMessage());
    }
}