The following project is to be done in groups of 2-3 people.
Your job is to build an application that will manage the menu planning and shopping list for a multi-day catered event. The specifics of the interface and user interactions are up to you, but the system should support the following features:
The user must be able to specify the number of people attending the event (and hence in need of feeding).
For each day of the event, the user can add one or more recipes. Each recipe consists of an ingredients list, the number of servings the recipe makes, and the instructions for cooking.
As each recipe is added, its ingredients are added to a shopping list. If other recipes exist with the same ingredients, the total amounts of each ingredient are recorded. For example, two recipes calling for 1 cup of rice each will cause the shopping list to contain an order for 2 cups of rice.
The app should be able to generate two reports:
A cookbook, containing the recipes for each day, with the proportions of each ingredient adjusted for the number of attendees at the event.
A shopping list, containing the total amounts of all ingredients to buy for the event.
For every class you implement, include an appropriate representation invariant check. This method should be called at the entry to and exit from every public method call.
In a similar vein, if a public method makes assumptions about its arguments (beyond the concerns of type information), include an assertion of a precondition at the beginning of the method. Post-conditions are sometimes harder to implement in this way, but put them in where you can and where it's useful to do so.
I've left off a lot of considerations from the specification above. For pride of place and skills development of your final semester project, you might add in some, all, (or none, I suppose), of the following features:
Save your menu plan to a data file, for future editing. This will involve not only the basic items of file opening, saving, and closing, but also the ability to both read and write a common data format. For that purpose, I'd suggest XML, as there are many existing open source libraries for handling this format. See, for example, http://www.java-samples.com/showtutorial.php?tutorialid=152.
Output your cookbook and shopping list as neatly-formatted PDF files. This is actually easier than you might think (unless you want to implement sophisticated text layout), using any one of a number of freely-available PDF libraries. PDFBox, for example, will do most of what you'll likely envisage.
On Friday, you will demo your software, reveal the secrets you've gleaned about other teams' implementations, and we'll critique the components as a group.