Updated for Fall 2026
CoffeeMaker Requirements
Because most computer scientists love their morning (and afternoon) cup of coffee or tea, we’re going to design and implement an online beverage ordering system similar to GrubHub. The requirements for the CoffeeMaker program are described below as use cases, which is a way of modeling requirements from the user’s perspective.
Use cases combine together related scenarios around a key action. They describing the preconditions to reach the use case, the main flow of functionality, extensions to main flow functionality, and alternative or error paths.

Use Case 1: Display Menu
Display a menu of options for working with the CoffeeMaker systems for a user.
Main Flow
- A user goes to the CoffeeMaker website.
- A user selects one of the following menu options:
Use Case 2: Add Recipe
Preconditions
User selected the Add Recipe option from the menu [UC1]
Main Flow
- A user selects the option to add a recipe.
- The user enters the name, price, units coffee, units tea, units sugar, units milk, and units chocolate that make up the recipe. The user clicks Submit. The recipe is saved. [Too Many] [Invalid Price] [Invalid Unit] [Duplicate].
- The user returns to the main menu [UC1].
Alternative Flows
- [Too Many] If there are already three recipes in the system, then a new recipe may not be added. An error message is printed, and the recipe is not added.
- [Invalid Price] The price must be a positive integer. If the price is not a positive integer then, an error message is printed, and the user is returned to the form to edit. The recipe is not added.
- [Invalid Unit] The units of coffee, sugar, milk, and chocolate must be positive integers. If the unit value on any of the ingredients is not a positive integer, an error message is printed, and the user is returned to the form to edit. The recipe is not added.
- [Duplicate] If the name of the new recipe already exists in a recipe in the system, an error message is printed, and the user is returned to the form to edit.The recipe is not added.
Use Case 3: Delete Recipe
Preconditions
User selected the Delete Recipe option from the menu [UC1]
Main Flow
- The user will be shown a list of all recipes in the system.
- The user may select one or more recipes that they want to delete.
- The user selects the option to delete the recipes.
- The selected recipes are deleted and a success message is displayed [Cannot Delete].
- The user returns to the main menu [UC1].
Alternative Flows
- [Cannot Delete] If the recipe is deleted by a concurrent user before it’s selected for deletion, an error message is printed and the user is returned to the delete recipe page with an updated list of recipes.
Use Case 4: Edit Recipe
Preconditions
User selected the Edit Recipe option from the menu [UC1]
Main Flow
- The user will be shown a list of all recipes in the system.
- The user may select one recipe that they want to edit [E1].
- After selecting a recipe, the form will be pre-filled with all existing values (price, units coffee, units sugar, units milk, and units chocolate) for selected recipe.
- The user edits the price, units coffee, units tea, units sugar, units milk, and units chocolate that make up the recipe [Cannot Edit] [Invalid Price] [Invalid Unit].
- The user returns to the main menu [UC1].
Alternative Flows
- [Cannot Edit] If the recipe is deleted by a concurrent user before it’s selected for edit, an error message is printed and the user is returned to the edit recipe page with an updated list of recipes.
- [Invalid Price] The price must be a positive integer. If the price is not a positive integer then, an error message is printed, and the user is returned to the form to edit. The recipe is not added.
- [Invalid Unit] The units of coffee, sugar, milk, and chocolate must be positive integers. If the unit value on any of the ingredients is not a positive integer, an error message is printed, and the user is returned to the form to edit. The recipe is not added.
Use Case 5: Add Inventory
Preconditions
User selected the Add Inventory option from the menu [UC1]
Main Flow
- The user will be shown a listing of the current inventory of ingredients in the CoffeeMaker.
- The user enters the amount of inventory to add for each ingredient [Invalid Unit].
- The current inventory values are updated after inventory is added.
- The user returns to the main menu [UC1].
Alternative Flows
- [Invalid Unit] The units of coffee, sugar, milk, and chocolate must be positive integers. If the unit value on any of the ingredients is not an integer, an error message is printed, and the user is returned to the form to edit. No inventory is added.
Use Case 6: Order Beverage
Preconditions
User selected the Order Beverage option from the menu [UC1]
Main Flow
- The user will select the beverage they want to purchase.
- The user will enters the amount of money they will use to purchase the beverage.
- The user requests the beverage.
- The system will check if there are enough ingredients in the inventory to make the selected beverage [Insufficient Ingredients].
- The system will check if there is enough money to pay for the beverage [Insufficient Payment] [Invalid Payment].
- If there are enough ingredients and the money paid is sufficient, the ingredients to make the purchased beverage will be removed from the inventory.
- A message indicating that the beverage is ready and the user’s change will be displayed.
- The user may return to the main menu [UC1].
Alternative Flows
- [Insufficient Ingredients] If there is not enough inventory to make the beverage, an error message is printed, the user’s money will be returned, and the user will be returned to the purchase beverage page. No inventory is used.
- [Insufficient Payment] If the user does not enter enough money, an error message is printed, their money will be returned, and the user will be returned to the purchase beverage page. No inventory is used.
- [Invalid Payment] If the payment entered is not numeric or not an integer, an error message is printed, the user’s money will be returned (if the input was numeric), and the user will be returned to the purchase beverage page. No inventory is used.
