Class GroceryTrip

Object
GroceryTrip

public class GroceryTrip extends Object
This class creates a Scanner and GroceryList object to make an "App" for the GroceryList. Once begun, you issue commands to invoke different methods.
  • Field Details

  • Constructor Details

    • GroceryTrip

      public GroceryTrip()
  • Method Details

    • printOptions

      public void printOptions()
      Welcomes and prints options for GroceryTrip user.
    • getAction

      public String getAction()
      Gets the Scanner object's next line.
      Returns:
      First letter of Scanner.nextLine()
    • actionLoop

      public void actionLoop(String action)
      Loop that uses and sets the action parameter each iteration. Depending on the action, calls a different method for operations.
    • addAction

      public void addAction()
      Gets user input and adds grocery depending on provided String.
    • removeAction

      public void removeAction()
      Gets user input and removes grocery depending on provided String.
    • printAction

      public void printAction()
      Prints entire Grocery List.
    • getAisleAction

      public void getAisleAction()
      Prints all groceries within a certain user-specified aisle.
    • totalAction

      public void totalAction()
      Prints the totals associated with the Grocery List.