Coffeemaker Example: Contact Authors North Carolina State University CSC 326
Coffeemaker Example: Contact Authors North Carolina State University CSC 326
Coffeemaker Example: Contact Authors North Carolina State University CSC 326
The Computer Science department at NCSU has a new building on Centennial Campus. We all know that computer scientists love caffeine,
so the CSC department is planning on installing a CoffeeMaker in a lounge across the hall from the 24-hour computer lab. Our job is to test
and model the functionality of the CoffeeMaker. We are only working with the logic code behind the hardware, so only a command line
interface is used for manual testing. Here is a partial listing of requirements for the CoffeeMaker system. Use this as a reference when
completing the CSC 326 tutorials.
When the Coffee Maker is not in use it waits for user input. There are six different options
of user input: 1) add recipe, 2) delete a recipe, 3) edit a recipe, 4) add inventory, 5) check
inventory, and 6) purchase beverage.
Only three recipes may be added to the CoffeeMaker. A recipe consists of a name, price,
units of coffee, units of milk, units of sugar, and units of chocolate. Each recipe name
must be unique in the recipe list. Price must be handled as an integer. A status message
is printed to specify if the recipe was successfully added or not. Upon completion, the
CoffeeMaker is returned to the waiting state.
A recipe may be deleted from the CoffeeMaker if it exists in the list of recipes in the
CoffeeMaker. The recipes are listed by their name. Upon completion, a status message is
printed and the Coffee Maker is returned to the waiting state.
A recipe may be edited in the CoffeeMaker if it exists in the list of recipes in the
CoffeeMaker. The recipes are listed by their name. After selecting a recipe to edit, the user
will then enter the new recipe information. A recipe name may not be changed. Upon
completion, a status message is printed and the Coffee Maker is returned to the waiting
state.
Inventory may be added to the machine at any time from the main menu, and is added to
the current inventory in the CoffeeMaker. The types of inventory in the CoffeeMaker are
coffee, milk, sugar, and chocolate. The inventory is measured in integer units. Inventory
may only be removed from the CoffeeMaker by purchasing a beverage. Upon completion,
a status message is printed and the CoffeeMaker is returned to the waiting state.
Inventory may be checked at any time from the main menu. The units of each item in the
inventory are displayed. Upon completion, the Coffee Maker is returned to the waiting
state.
CoffeeMaker Example for CSC 326 Tutorials ©2003-2008 North Carolina State University, Laurie Williams, Dright Ho, Sarah Heckman
Email the authors with any questions or comments about this example.
Last Updated: Monday, March 30, 2009 3:34 PM