Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

ronpearl/CST115-Final-Project

Repository files navigation

CST115 Final Project - Vending Machine

Program:

Vending Machine

Authors:

Ronald Pearl, Aaron Fonseca, Kris Hayes

Summary:

Final Project for CST-115 class

Date:

8/8/16 - 9/25/16

Description:

The vending machine will have two types of users – a customer, who will be able to select a product, and a BOSS, who will be able to maintain the collection of products in the machine. The machine itself will have a graphical interface that displays the available products and allows the user to make selections. The BOSS will have a separate interface that provides a variety of maintenance options. The machine will provide a means of alternating between the two types of users.

Milestone 1

  1. Sketch a storyboard of end product that shows the flow of the application (e.g., user input, application output).
  2. Design a class using UML that models a product one might find in a snack machine. Submit UML for their product class. Submit a document with your UML.
  3. Design a class using UML that models a dispenser of products. Students should submit UML for their dispenser class. Submit your UML as a document.

Milestone 2

Part 1: Design an inheritance hierarchy using UML

Create and submit a design document that includes a UML for the following class hierarchy:

  1. Product class
  2. Drink class and Snack class (sub-classes of Product)
  3. Candy class, Chips class and Gum class (sub-classes of Snack)

Your diagram should be developed using a tool such as Visio or MS Word and should illustrate the relationship between the classes.

Make sure that all classes include the following:

  1. No argument constructor
  2. Overloaded constructor that initializes the fields with the parameters
  3. Overloaded copy constructor that initializes the fields with a copy of another object’s fields
  4. A toString() method

You should add other methods you think are relevant to your class.

Part 2: Implementing the classes

Using your UML, write the code to implement the following classes:

  1. Product (make this class abstract)
  2. Snack (make this class abstract)
  3. Drink
  4. Candy
  5. Chips
  6. Gum
  7. Dispenser (add a constructor that populates the Dispenser class array with a variety of Products)
  8. Finally, write a main method that creates a Dispenser and calls the Dispenser method displayProducts().

Milestone 3

Update your Snack and Drink classes so that they implement the Comparable interface. Comparison is based on the name of the item and follows alphabetical ordering rules, ignoring case. In other words, the Drink “Cola” is less than the Drink “Tea”. Items with the same name should be ordered on price in ascending order. If two items have the same name and price, they are considered equal. Write a main method that tests your compareTo() method. Submit your updated class files.

Milestone 4

Use JavaFX to create the user interface for dispensing the product. You can design the user interaction as you see fit, but at the minimum the following components must be present:

  1. A grid pane containing the images of the categories of available items (e.g., drinks, sweets, gum)
  2. Each category should be associated with a clickable button.
  3. Upon clicking the button, the display will change to show a different grid pane containing the available items in that category.
  4. Each item should include a description and price.
  5. Upon clicking the “done” button, the program will display, in a separate pane, the list of items, their price, and the total of the transaction.

Milestone 5

Part 1: Manage Inventory

  1. Create an inventory management class with appropriate methods that implement the functionality described below:
  2. Upon selecting an item the inventory, the stock for the item reduces by 1.
  3. Upon canceling a selection, the stock for the item should increase by 1.
  4. Define an additional event of your choosing in the context of interacting with a vending machine and implement it.
  5. Add a button that triggers the display of the entire inventory (for example to be used by the person who services the vending machine). The inventory should be displayed in a separate grid pane.

Part 2: Animate GUI elements

  1. Create an animation class to handle the visual “effects” described below:
  2. For each item, upon selection, animate it “falling into a basket.”
  3. Modify the existing the user interface as needed to accommodate the new elements.
  4. Ensure that visual changes on the screen are matched with the functionality implemented in part one.

Milestone 6

Part 1:

  1. Create a CSV file with the contents of the inventory of your vending machine. Note that the categories and items will differ from team to team. You will have to coordinate the types of information and categories so that the files generated by each team have the same format.
  2. Upload your CSV file to a shared folder in the Git repository where every team can access it.
  3. Download all CSV files published by the teams in your class.
  4. Write a class Global_Inventory_Management with the following functionality:

a. Read all the files into an array of objects, where each object is an instance of the product class (i.e., an individual item from a vending machine).

b. Recursively sort the array by item name and quantity.

c. Recursively search for an item by name. When found return its location (i.e., the specific vending machine) and quantity.

d. Generate a text document that shows the call stack for recursive search.

Part 2:

  1. Create a user interface for a manager of multiple vending machines. You are free to design the GUI elements as you see fit in order to support the functionality described below.
  2. Create a class Restock that generates a “restocking list” and implements the following:

a. Define “low inventory” for inventory of three or less items available in a given vending machine.

b. Read the data for each vending machine (see part 1) and generate a purchase order for each vending machine. For each vending machine, the purchase order should include the name of the machine, the name of the item, the quantity to order, and the total cost.

Milestone 7

Part 1: Customer Queue

  1. Create a CSV text file that contains a list of customers and their intended purchases. For example:
    John, diet lemonade John, chocolate bar Susan, chips …. END
  2. Create a class ProcessCustomerQueue that implements the following functionality:

a. Read the list of customers from a text file into a Queue structure.

b. Implement the complete Queue functionality as individual methods: i. First() ii. Length() iii. In() iv. Out() v. isEmpty()

c. For each customer in the Queue: i. Attempt to perform the requested purchase

ii.	If the item is available, perform the transaction using the functionality implemented in earlier milestones

iii.	If the item is unavailable, automatically generated an alternative selection choosing an available item and perform the transaction 

iv.	Upon completing the transaction, remove the customer from the Queue.  

Part 2: Customer Queue GUI

  1. Create a CustomerDisplay class, implementing an animated visual display of customers in the Queue (e.g., a line of small icons depicting persons)
  2. Create an animated visual display of each customer interacting with the vending machine. Be creative and use simple effects that illustrate the interaction.
  3. Display messages in text fields that indicate:

a. The name of the customer and his/her selection

b. The total amount of the transaction

c. An alert if item is unavailable and the alternative selection made (consider making a random choice or another creative alternative). Display alerts as a text-based log (e.g., in a separate text field) so as not to interrupt the visualization of processing the queue of customers

d. A message indicating when all customers have been served and display the current inventory (you have already implemented this portion in the inventory milestone)

Milestone 8

  1. Review all your project milestones.
  2. Identify one additional, substantial, useful feature that could be added to your project.
  3. Implement the GUI and code associated with that feature.
  4. Review the latest documentation you prepared for your project. Update your documentation to include the areas of responsibility of each member in your team. Address difficulties or challenges you encountered as a team.
  5. Create a five-ten minute presentation of your project, addressing the following:

a. Overview of your approach to implementing the project

b. The GUI elements pointing out key functionality

c. One or two interesting functions or features in your code that were particularly challenging to implement (show a code snippet)

d. Demonstrate your working project; Create a Screen cast recording showing the working project, including a voice over to accompany the project demonstration. Use CamStudio (Windows) or QuickTime (Mac) and output result to a video file. The screencast recording can be used as a standalone presentation (e.g. on a portfolio website)

e. Share with the class how you overcame an unexpected challenge.

Files

Storyboard is located in the Storyboard folder. Product and Dispenser classes and their UMLs are in the Final_Project package. Inventory csv files are included for 2 seperate machines Image files are included for some products, the remaining are linked to external websites (Internet connection required)

About

CST-115 Class Files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages