I get no compile errors. Just Runtime exception
Your printf
format is wrong
System.out.printf("Receipt\n Name: %d\n ...... , name...);
name
is a String not a number d
Receipt\n Name: %d\n
Should be
Receipt\n Name: %s\n
The s
is for String
Other than that, the program runs fine for me. Before I made the change, I would get
IllegalFormatConversionException: d != java.lang.String
Which makes sense because String is not a number