Having the loop at the end of the code isn't going to help you, and changing the user's choice (by subtracting 5) also seems unlikely to make the user happy. You should put the loop around where you ask the user for the meal code. Try to set up the loop so you will enter it once no matter what, enter it again if the input is invalid, and exit it if the input is valid.
I think you are mistaken trying to validate your meal code inside your main method. A main method is intended for starting your application, and you should restrict your methods to doing one thing. I think you should write yourself a utility class with such methods in. You can find an example here. You can write another method (in the same utility class) which validates the input is in the required range, (is it 1…5?) and prints an error message on screen. Those two methods call each other, so you are not duplicating code. Remember all members of utility classes are static.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com