Class DisplayScreen

java.lang.Object
  extended by DisplayScreen

public class DisplayScreen
extends java.lang.Object

Represents the display screen and touch pad of a vending machine Also represents the controller of the program


Constructor Summary
DisplayScreen()
          Constructs a new DisplayScreen object
 
Method Summary
 void displayOperatorOptions()
          Displays the options available for any Operator of the VendingMachine
 void displayProducts()
          Displays the Products in the VendingMachine to the user
 void displayWelcome()
          Displays the first screen to be seen by a user of this VendingMachine.
 int getOperatorChoice()
          Returns the Operator's choice (0 = "exit", 1 = "restock a product", 2 = "remove money")
 void operatorFailureToLogIn()
          Displays an error when someone fails to log in as a Operator, then restarts from the welcome screen
 boolean operatorLogin()
          Walks the Operator through the login process
 void operatorRemovesMoney()
          Removes all the coins from this VendingMachine object and reports number of coins removed to the Operator
 void operatorRestocksProduct()
          Allows an Operator to restock a particular Product
 void run()
          Runs the Vending Machine program
 void userPaysForProduct(int productIndexPlusOne)
          Allows the user to pay for a already-selected Product
 int userSelectsProduct()
          Allows the user to select a Product to purchase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DisplayScreen

public DisplayScreen()
Constructs a new DisplayScreen object

Method Detail

displayWelcome

public void displayWelcome()
Displays the first screen to be seen by a user of this VendingMachine. Will determine if the user is a customer or an Operator of the machine.


operatorLogin

public boolean operatorLogin()
Walks the Operator through the login process


operatorFailureToLogIn

public void operatorFailureToLogIn()
Displays an error when someone fails to log in as a Operator, then restarts from the welcome screen


displayOperatorOptions

public void displayOperatorOptions()
Displays the options available for any Operator of the VendingMachine


getOperatorChoice

public int getOperatorChoice()
Returns the Operator's choice (0 = "exit", 1 = "restock a product", 2 = "remove money")

Returns:
the Operator's choice

operatorRestocksProduct

public void operatorRestocksProduct()
Allows an Operator to restock a particular Product


operatorRemovesMoney

public void operatorRemovesMoney()
Removes all the coins from this VendingMachine object and reports number of coins removed to the Operator


displayProducts

public void displayProducts()
Displays the Products in the VendingMachine to the user


userSelectsProduct

public int userSelectsProduct()
Allows the user to select a Product to purchase

Returns:
the Product selected by the user

userPaysForProduct

public void userPaysForProduct(int productIndexPlusOne)
Allows the user to pay for a already-selected Product

Parameters:
productIndexPlusOne - the selected Product code

run

public void run()
Runs the Vending Machine program