2020-11-11 10:46:50 -05:00
|
|
|
import java.util.Scanner;
|
|
|
|
|
|
|
|
public class ShoppingCartManager {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
|
|
|
//Ask for customer name and today's date
|
|
|
|
//Output the name and date
|
|
|
|
//Create a shoppingCart
|
|
|
|
//
|
|
|
|
//Implement printMenu(ShoppingCart cart) method
|
|
|
|
//
|
|
|
|
Scanner scnr = new Scanner(System.in);
|
2020-11-11 11:54:52 -05:00
|
|
|
ShoppingCart cart = new ShoppingCart();
|
|
|
|
printMenu(cart, scnr);
|
|
|
|
|
2020-11-11 10:46:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
public void printMenu(ShoppingCart cart, Scanner scnr){
|
|
|
|
|
|
|
|
char userInput;
|
|
|
|
userInput = 0;
|
|
|
|
|
|
|
|
while (userInput != 'q'){
|
2020-11-11 11:54:52 -05:00
|
|
|
System.out.println("MENU\n"+
|
2020-11-11 10:46:50 -05:00
|
|
|
"a - Add item to cart\n"+
|
|
|
|
"d - Remove item from cart\n"+
|
|
|
|
"c - Change item quantity\n"+
|
|
|
|
"i - Output items' descriptions\n"+
|
|
|
|
"o - Output shopping cart\n"+
|
|
|
|
"q - Quit");
|
|
|
|
userInput = scnr.next().charAt(0);
|
|
|
|
|
2020-11-11 11:54:52 -05:00
|
|
|
switch (userInput) {
|
|
|
|
case 'a': break;
|
|
|
|
case 'd': break;
|
|
|
|
case 'c': break;
|
|
|
|
case 'i': cart.printDescriptions();
|
|
|
|
break;
|
|
|
|
case 'o': break;
|
|
|
|
}
|
2020-11-11 10:46:50 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-11 11:54:52 -05:00
|
|
|
public void addItem(){
|
|
|
|
}
|
|
|
|
public void removeItem(){
|
|
|
|
}
|
|
|
|
public void changeItemQuantity(){
|
|
|
|
}
|
|
|
|
public void outputCart(){
|
|
|
|
}
|
|
|
|
|
2020-11-11 10:46:50 -05:00
|
|
|
}
|