MainApplication.java 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /**
  2. * Created by leon on 1/10/18.
  3. */
  4. public class MainApplication {
  5. public static void main(String[] args) {
  6. InventoryManager system = new InventoryManager();
  7. String temp;
  8. int tempPrice;
  9. int tempOnHand;
  10. boolean onOff = true;
  11. System.out.println("Welcome to the inventory tracker.\n");
  12. while(onOff = true){
  13. switch(system.getStringInput("What Would You Like To Do?\n" + "ADD product\n" +
  14. "ADD INVENTORY of an existing product \n" + "DISPLAY all current products\n" +
  15. "REMOVE a product from the system\n" +"EXIT the system\n")){
  16. case "add" :
  17. temp = system.getStringInput("What Product Are You Adding?");
  18. tempPrice = system.getIntegerInput("What Is The Product's Price?");
  19. tempOnHand = system.getIntegerInput("How Many Do You Have?");
  20. system.addProduct(temp,tempPrice,tempOnHand);
  21. break;
  22. case "add inventory" :
  23. temp = system.getStringInput("What Product Are You Adding Inventory To?");
  24. tempOnHand = tempOnHand = system.getIntegerInput("How Much Are You Adding?");
  25. system.addInventory(temp,tempOnHand);
  26. break;
  27. case "display" : system.displayInventory();
  28. break;
  29. case "remove" :
  30. temp = system.getStringInput("Which Product Do You Want To Remove?");
  31. system.removeProduct(temp);
  32. break;
  33. case "exit" : onOff = false;
  34. break;
  35. default: System.out.println("Invalid Choice: Please Try Again");
  36. break;
  37. }
  38. }
  39. System.out.println("Goodbye");
  40. }
  41. }