diff --git a/data/recipeList.txt b/data/recipeList.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/docs/team/liuziyang.md b/docs/team/liuziyang.md index ab75b391b8..2ac27f26a5 100644 --- a/docs/team/liuziyang.md +++ b/docs/team/liuziyang.md @@ -1,6 +1,7 @@ -# John Doe - Project Portfolio Page +# Liu Ziyang - Project Portfolio Page ## Overview - +Responsible for all items in the User Guide. ### Summary of Contributions + diff --git a/src/main/java/seedu/duke/Duke.java b/src/main/java/seedu/duke/Duke.java index 01ea2a609a..e9ce1dc0f5 100644 --- a/src/main/java/seedu/duke/Duke.java +++ b/src/main/java/seedu/duke/Duke.java @@ -4,7 +4,7 @@ import seedu.duke.parser.Parser; import seedu.duke.recipe.RecipeList; import seedu.duke.storage.Storage; -import seedu.duke.ui.Ui; +import seedu.duke.ui.UI; /** * Represents the Recipe Manager programme. A Duke object corresponds to @@ -13,7 +13,7 @@ public class Duke { private final RecipeList recipes; - + private final UI ui = new UI(); /** * Class constructor specifying filePath for saving data. * @@ -24,10 +24,10 @@ public Duke(String filePath) { try { Storage.createSavedFile(); } catch (Exception e) { - Ui.showLoadingErrorMessage(e); + ui.showLoadingErrorMessage(e); } finally { recipes = new RecipeList(); - Ui.showLine(); + ui.showLine(); } } @@ -36,20 +36,20 @@ public Duke(String filePath) { * it is terminated by the user. */ public void run() { - Ui.showWelcome(); - Ui.showLine(); + ui.showWelcome(); + ui.showLine(); boolean isExit = false; while (!isExit) { try { - String fullCommand = Ui.readCommand(); - Ui.showLine(); + String fullCommand = ui.readCommand(); + ui.showLine(); Command c = Parser.parseCommands(fullCommand); - c.execute(recipes); + c.execute(recipes,ui); isExit = c.isExit(); } catch (Exception e) { - Ui.showDudeMainError(e); + ui.showDudeMainError(e); } finally { - Ui.showLine(); + ui.showLine(); } } } diff --git a/src/main/java/seedu/duke/DukeUI.java b/src/main/java/seedu/duke/DukeUI.java deleted file mode 100644 index 7f77fc133f..0000000000 --- a/src/main/java/seedu/duke/DukeUI.java +++ /dev/null @@ -1,30 +0,0 @@ -package seedu.duke; - -import java.util.Scanner; - -public class DukeUI { - private static final String LINE = "____________________________________________________________"; - private static final String DUKE_LOGO = "Hello from\n" + - " ____ _ \n" - + "| _ \\ _ _| | _____ \n" - + "| | | | | | | |/ / _ \\\n" - + "| |_| | |_| | < __/\n" - + "|____/ \\__,_|_|\\_\\___|\n"; - public Scanner in; - - public DukeUI() { - in = new Scanner(System.in); - } - public String readCommand() { - return in.nextLine(); - } - public void printDukeLogo() { - System.out.println(DUKE_LOGO); - } - public void printGreeting(){ - printDukeLogo(); - } - public void printLine(){ - System.out.println(LINE); - } -} diff --git a/src/main/java/seedu/duke/command/Command.java b/src/main/java/seedu/duke/command/Command.java index be2dbb8f38..1110f89fb3 100644 --- a/src/main/java/seedu/duke/command/Command.java +++ b/src/main/java/seedu/duke/command/Command.java @@ -6,7 +6,7 @@ import seedu.duke.recipe.IngredientList; import seedu.duke.recipe.Recipe; import seedu.duke.recipe.RecipeList; -import seedu.duke.ui.Ui; +import seedu.duke.ui.UI; import java.util.ArrayList; @@ -48,13 +48,13 @@ public boolean isExit() { * * @param recipeList the current list of recipes to be modified or used. */ - public void execute(RecipeList recipeList) { + public void execute(RecipeList recipeList, UI ui) { int recipeListIndex; switch (type) { case LIST: - Ui.showRecipeList(recipeList.getRecipeList()); + ui.showRecipeList(recipeList.getRecipeList()); break; case ADD: try { @@ -67,9 +67,9 @@ public void execute(RecipeList recipeList) { String recipeTag = parsed.get(2); ArrayList recipeSteps = new ArrayList<>(); recipeList.addNewRecipe(new Recipe(recipeName, recipeTag, ingredientLists, recipeSteps)); - Ui.showRecipeAdded(recipeList.getNewestRecipe(), recipeList.getCurrRecipeNumber()); + ui.showRecipeAdded(recipeList.getNewestRecipe(), recipeList.getCurrRecipeNumber()); } catch (Exception e) { - Ui.showAddingRecipeErrorMessage(e); + ui.showAddingRecipeErrorMessage(e); } break; case DELETE: @@ -79,10 +79,10 @@ public void execute(RecipeList recipeList) { } recipeListIndex = Integer.parseInt(fullDescription); Recipe recipeToBeDeleted = recipeList.getRecipeFromList(recipeListIndex); - Ui.showRecipeDeleted(recipeToBeDeleted, recipeList.getCurrRecipeNumber() - 1); + ui.showRecipeDeleted(recipeToBeDeleted, recipeList.getCurrRecipeNumber() - 1); recipeList.removeRecipe(recipeListIndex); } catch (Exception e) { - Ui.showDeletingTaskErrorMessage(e, type); + ui.showDeletingTaskErrorMessage(e, type); } break; case FIND: @@ -97,22 +97,38 @@ public void execute(RecipeList recipeList) { findRecipeResults.add(recipe); } } - Ui.showFindResults(findRecipeResults, keywords); + ui.showFindResults(findRecipeResults, keywords); } catch (Exception e) { - Ui.showFindingTaskErrorMessage(e); + ui.showFindingTaskErrorMessage(e); + } + break; + case CLEAR: + recipeList.clearRecipeList(); + ui.showRecipeListCleared(); + break; + case VIEW: + try { + if (fullDescription.isEmpty()) { + throw new IncompleteInputException("The index of " + type + " cannot be empty.\n"); + } + recipeListIndex = Integer.parseInt(fullDescription); + Recipe recipeToBeViewed = recipeList.getRecipeFromList(recipeListIndex); + ui.showRecipeViewed(recipeToBeViewed); + } catch (Exception e) { + ui.showViewingRecipeErrorMessage(e); } break; case HELP: - Ui.showHelp(); + ui.showHelp(); break; case EXIT: - Ui.showExit(); + ui.showExit(); break; case UNKNOWN: - Ui.showUnrecognizableErrorMessage(); + ui.showUnrecognizableErrorMessage(); break; default: - Ui.showUnrecognizableCommandErrorMessage(); + ui.showUnrecognizableCommandErrorMessage(); } } } diff --git a/src/main/java/seedu/duke/command/CommandType.java b/src/main/java/seedu/duke/command/CommandType.java index ba6f448008..4c01e4e122 100644 --- a/src/main/java/seedu/duke/command/CommandType.java +++ b/src/main/java/seedu/duke/command/CommandType.java @@ -38,7 +38,11 @@ public enum CommandType { */ HELP, /** - * Terminates the programme and exit with saving. + * Clear the current recipe list. + */ + CLEAR, + /** + * Terminates the programme and exit without saving. */ EXIT, /** diff --git a/src/main/java/seedu/duke/parser/Parser.java b/src/main/java/seedu/duke/parser/Parser.java index 21c6ea3d26..406dc5f0e8 100644 --- a/src/main/java/seedu/duke/parser/Parser.java +++ b/src/main/java/seedu/duke/parser/Parser.java @@ -54,6 +54,9 @@ public static Command parseCommands(String line) { case "find": type = CommandType.FIND; break; + case "clear": + type = CommandType.CLEAR; + break; case "exit": type = CommandType.EXIT; break; diff --git a/src/main/java/seedu/duke/recipe/Ingredient.java b/src/main/java/seedu/duke/recipe/Ingredient.java index aee4e293c9..722cd03a3b 100644 --- a/src/main/java/seedu/duke/recipe/Ingredient.java +++ b/src/main/java/seedu/duke/recipe/Ingredient.java @@ -6,4 +6,7 @@ public class Ingredient { public Ingredient(String inputName) { name = inputName; } + public String getName() { + return name; + } } diff --git a/src/main/java/seedu/duke/recipe/IngredientList.java b/src/main/java/seedu/duke/recipe/IngredientList.java index ff025ca434..e696dcaef1 100644 --- a/src/main/java/seedu/duke/recipe/IngredientList.java +++ b/src/main/java/seedu/duke/recipe/IngredientList.java @@ -49,4 +49,10 @@ private void removeIngredient(int index) { list.remove(index-1); currIngredientNumber--; } + public void showList() { + System.out.println("Here are " + currIngredientNumber + " ingredients in the list:"); + for (int i = 0; i < currIngredientNumber; i++) { + System.out.println((i + 1) + ". " + list.get(i).getName()); + } + } } diff --git a/src/main/java/seedu/duke/recipe/Recipe.java b/src/main/java/seedu/duke/recipe/Recipe.java index b020922d72..842e7d1e06 100644 --- a/src/main/java/seedu/duke/recipe/Recipe.java +++ b/src/main/java/seedu/duke/recipe/Recipe.java @@ -30,7 +30,6 @@ public String getName() { public String getTag() { return tag; } - public String toString() { return '[' + tag + "] " + name; } diff --git a/src/main/java/seedu/duke/recipe/RecipeList.java b/src/main/java/seedu/duke/recipe/RecipeList.java index 0a237dae75..8dc12b41b9 100644 --- a/src/main/java/seedu/duke/recipe/RecipeList.java +++ b/src/main/java/seedu/duke/recipe/RecipeList.java @@ -23,6 +23,7 @@ public ArrayList getRecipeList() { } public int getCurrRecipeNumber() { + assert(currRecipeNumber == recipeList.size()); return currRecipeNumber; } @@ -46,4 +47,8 @@ public void removeRecipe(int index) throws RecipeListEmptyError { recipeList.remove(index-1); currRecipeNumber--; } + public void clearRecipeList() { + recipeList.clear(); + currRecipeNumber = 0; + } } diff --git a/src/main/java/seedu/duke/ui/StringLib.java b/src/main/java/seedu/duke/ui/StringLib.java index 7ea2740fea..feb1fd523e 100644 --- a/src/main/java/seedu/duke/ui/StringLib.java +++ b/src/main/java/seedu/duke/ui/StringLib.java @@ -10,7 +10,7 @@ public interface StringLib { + " \\_/\\__,_|___/\\__\\___| \\___/|_| \\_| |_/\\___/|_| |_| |_| |___/ | | \\_/ \\___/\\_| |_/| |" + "\n" + " \\_\\ /_/\n"; - String WELCOME_MESSAGE = "\nHELLLOO there! I am\n " + String WELCOME_MESSAGE = "\nHELLO there! I am\n " + LOGO + '\n' + "Your personal recipes assistant!\n" + "What can I do for you today?\n\n" @@ -83,6 +83,8 @@ public interface StringLib { + "\nException occurred: "; String RECIPE_FINDING_DEFAULT_ERROR = "\nError in finding recipe!" + "\nException occurred: "; + String RECIPE_VIEWING_DEFAULT_ERROR = "\nError in viewing recipe!" + + "\nException occurred: "; String FORMAT_CONVERT_ERROR = "\nError in inputs!" + "\nException occurred: The number is too big to process or the inputs contains words when " + "it is supposed to be numbers." @@ -106,5 +108,5 @@ public interface StringLib { + "i/ \"\n" + "\"t/\\\"\\n\"\n" + "\"Example use : \\\"add n/Hotpot i/Beef, Potatoes, Carrots t/Chinese\\\" \\n \\n\""; - + String RECIPE_CLEARED_MESSAGE = "\nAll recipes have been cleared!"; } diff --git a/src/main/java/seedu/duke/ui/Ui.java b/src/main/java/seedu/duke/ui/UI.java similarity index 69% rename from src/main/java/seedu/duke/ui/Ui.java rename to src/main/java/seedu/duke/ui/UI.java index 241a98837c..9b64527d3e 100644 --- a/src/main/java/seedu/duke/ui/Ui.java +++ b/src/main/java/seedu/duke/ui/UI.java @@ -4,8 +4,14 @@ import seedu.duke.exceptions.FileParseReadingException; import seedu.duke.exceptions.IncompleteInputException; import seedu.duke.exceptions.RecipeListEmptyError; +import seedu.duke.recipe.IngredientList; import seedu.duke.recipe.Recipe; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Scanner; + import static seedu.duke.ui.StringLib.CREATING_NEW_FILE_AND_DIRECTORY; import static seedu.duke.ui.StringLib.DUDE_MAIN_ERROR; import static seedu.duke.ui.StringLib.EMPTY_LIST_MESSAGE; @@ -29,20 +35,18 @@ import static seedu.duke.ui.StringLib.UNRECOGNIZABLE_COMMAND_ERROR; import static seedu.duke.ui.StringLib.UNRECOGNIZABLE_ERROR; import static seedu.duke.ui.StringLib.WELCOME_MESSAGE; +import static seedu.duke.ui.StringLib.RECIPE_CLEARED_MESSAGE; +import static seedu.duke.ui.StringLib.RECIPE_VIEWING_DEFAULT_ERROR; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Scanner; - - -public class Ui { - - public static String readCommand() { - Scanner in = new Scanner(System.in); +public class UI { + private static Scanner in; + public UI() { + in = new Scanner(System.in); + } + public String readCommand() { return in.nextLine(); } - public static void showFindResults(ArrayList list, String keywords) { + public void showFindResults(ArrayList list, String keywords) { if (list.size() == 0) { System.out.println(NO_MATCHING_FIND_RESULTS_MESSAGE + keywords + '\n'); return; @@ -55,7 +59,7 @@ public static void showFindResults(ArrayList list, String keywords) { } System.out.println(); } - public static void showRecipeList(ArrayList list) { + public void showRecipeList(ArrayList list) { if (list.size() == 0) { System.out.println(EMPTY_LIST_MESSAGE); return; @@ -68,43 +72,46 @@ public static void showRecipeList(ArrayList list) { } System.out.println(); } - public static void showRecipeAdded(Recipe recipe, int recipeListSize) { + public void showRecipeAdded(Recipe recipe, int recipeListSize) { System.out.println('\n' + "Got it. I've added this recipe:"); System.out.println(" " + recipe.toString()); System.out.println("Now you have " + recipeListSize + " recipes in the list." + '\n'); } - public static void showRecipeDeleted(Recipe recipe, int recipeListSize) { + public void showRecipeDeleted(Recipe recipe, int recipeListSize) { System.out.println('\n' + "Noted. I've removed this recipe:"); System.out.println(" " + recipe.toString()); System.out.println("Now you have " + recipeListSize + " recipes in the list." + '\n'); } - public static void showWelcome() { + public void showRecipeListCleared() { + System.out.println(RECIPE_CLEARED_MESSAGE); + } + public void showWelcome() { System.out.println(WELCOME_MESSAGE); } - public static void showExit() { + public void showExit() { System.out.println(EXIT_MESSAGE); } - public static void showHelp() { + public void showHelp() { System.out.println(HELP); } - public static void showLine() { + public void showLine() { System.out.println(LINE); } - public static void showDudeMainError(Exception e) { + public void showDudeMainError(Exception e) { if (e instanceof IOException) { System.out.println(FILE_IO_ERROR + e); } else { System.out.println(DUDE_MAIN_ERROR + e); } } - public static void showUnrecognizableErrorMessage() { + public void showUnrecognizableErrorMessage() { System.out.println(UNRECOGNIZABLE_ERROR); } - public static void showUnrecognizableCommandErrorMessage() { + public void showUnrecognizableCommandErrorMessage() { System.out.println(UNRECOGNIZABLE_COMMAND_ERROR); } - public static void showLoadingErrorMessage(Exception e) { + public void showLoadingErrorMessage(Exception e) { if (e instanceof FileNotFoundException) { System.out.println(FILE_NOT_FOUND_ERROR + e + CREATING_NEW_FILE_AND_DIRECTORY); } else if (e instanceof FileParseReadingException) { @@ -113,7 +120,7 @@ public static void showLoadingErrorMessage(Exception e) { System.out.println(FILE_LOADING_DEFAULT_ERROR + e); } } - public static void showAddingRecipeErrorMessage(Exception e) { + public void showAddingRecipeErrorMessage(Exception e) { if (e instanceof IncompleteInputException) { System.out.println(MISSING_DESCRIPTION_ERROR + e); } else if (e instanceof StringIndexOutOfBoundsException) { @@ -122,7 +129,7 @@ public static void showAddingRecipeErrorMessage(Exception e) { System.out.println(RECIPE_ADDING_DEFAULT_ERROR + e); } } - public static void showDeletingTaskErrorMessage(Exception e, CommandType type) { + public void showDeletingTaskErrorMessage(Exception e, CommandType type) { if (e instanceof IncompleteInputException) { System.out.println(MISSING_DESCRIPTION_ERROR + e); } else if (e instanceof IndexOutOfBoundsException || e instanceof NullPointerException || @@ -132,11 +139,27 @@ public static void showDeletingTaskErrorMessage(Exception e, CommandType type) { System.out.println(RECIPE_DELETING_DEFAULT_ERROR + e); } } - public static void showFindingTaskErrorMessage(Exception e) { + public void showFindingTaskErrorMessage(Exception e) { if (e instanceof IncompleteInputException) { System.out.println(MISSING_INPUTS_ERROR + e); } else { System.out.println(RECIPE_FINDING_DEFAULT_ERROR + e); } } + public void showRecipeViewed(Recipe recipe) { + System.out.println("Here is the recipe you requested, which is a "+ recipe.getTag() + " flavour:"); + System.out.println("name: " + recipe.getName()); + IngredientList ingredients = recipe.getIngredientList(); + ingredients.showList(); + } + public void showViewingRecipeErrorMessage(Exception e) { + if (e instanceof IncompleteInputException) { + System.out.println(MISSING_DESCRIPTION_ERROR + e); + } else if (e instanceof IndexOutOfBoundsException || e instanceof NullPointerException || + e instanceof RecipeListEmptyError) { + System.out.println(PREFIX_EMPTY_LIMIT_LIST_ERROR + CommandType.VIEW + SUFFIX_EMPTY_LIMIT_LIST_ERROR); + } else { + System.out.println(RECIPE_VIEWING_DEFAULT_ERROR + e); + } + } } diff --git a/src/test/java/seedu/duke/UITest.java b/src/test/java/seedu/duke/UITest.java index ba94f73320..240fb457e9 100644 --- a/src/test/java/seedu/duke/UITest.java +++ b/src/test/java/seedu/duke/UITest.java @@ -3,11 +3,52 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.BeforeEach; +import seedu.duke.parser.Parser; +import seedu.duke.recipe.IngredientList; +import seedu.duke.recipe.Recipe; +import seedu.duke.recipe.RecipeList; +import seedu.duke.ui.UI; +import seedu.duke.command.CommandType; +import java.util.ArrayList; public class UITest { + UI ui; + RecipeList recipeList; + private final CommandType type = CommandType.DELETE; @Test void printGreeting() { assertTrue(true); } + @BeforeEach + void setUp() { + ui = new UI(); + recipeList = new RecipeList(); + try{ + ArrayList parsed = Parser.parseRecipe( + "add n/Spaghetti i/Pasta, Tomato Sauce, Cheese t/Italian"); + String recipeName = parsed.get(0); + IngredientList ingredientLists = Parser.parseIngredients(parsed.get(1)); + String recipeTag = parsed.get(2); + ArrayList recipeSteps = new ArrayList<>(); + Recipe recipe = new Recipe(recipeName, recipeTag, ingredientLists, recipeSteps); + recipeList.addNewRecipe(recipe); + } catch (Exception e) { + ui.showAddingRecipeErrorMessage(e); + } + } + @Test + void addRecipe() { + assert(recipeList.getCurrRecipeNumber() == 1); + } + @Test + void deleteRecipe() { + try { + recipeList.removeRecipe(1); + } catch (Exception e) { + ui.showDeletingTaskErrorMessage(e,type); + } + assert(recipeList.getCurrRecipeNumber() == 0); + } } diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index 66b4188eed..c8f9d0338f 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -4,7 +4,7 @@ Save file created. __________________________________________________________ -HELLLOO there! I am +HELLO there! I am _____ _ _____ __ ___ ___ _ _______ ________ ____ |_ _| | | | _ |/ _| | \/ | ( ) / /_ _| _ | \/ \ \ | | __ _ ___| |_ ___ | | | | |_ | . . | ___ _ __ ___ |/ ___ | | | | | | | | . . || | @@ -25,6 +25,140 @@ If you wish to view the full list of commands, simply type "help"! __________________________________________________________ __________________________________________________________ +MATE! Your list is empty! + +__________________________________________________________ +__________________________________________________________ + +Got it. I've added this recipe: + [Chinese] Hotpot +Now you have 1 recipes in the list. + +__________________________________________________________ +__________________________________________________________ + +Got it. I've added this recipe: + [Chinese] MaLaXiangGuo +Now you have 2 recipes in the list. + +__________________________________________________________ +__________________________________________________________ + +RECIPE LIST + +1. [Chinese] Hotpot +2. [Chinese] MaLaXiangGuo + +__________________________________________________________ +__________________________________________________________ + +Got it. I've added this recipe: + [Italian] Spaghetti +Now you have 3 recipes in the list. + +__________________________________________________________ +__________________________________________________________ + +Got it. I've added this recipe: + [Italian] Carbonara +Now you have 4 recipes in the list. + +__________________________________________________________ +__________________________________________________________ + +Got it. I've added this recipe: + [Chinese] Bejing Duck +Now you have 5 recipes in the list. + +__________________________________________________________ +__________________________________________________________ + +RECIPE LIST + +1. [Chinese] Hotpot +2. [Chinese] MaLaXiangGuo +3. [Italian] Spaghetti +4. [Italian] Carbonara +5. [Chinese] Bejing Duck + +__________________________________________________________ +__________________________________________________________ + +Noted. I've removed this recipe: + [Chinese] Hotpot +Now you have 4 recipes in the list. + +__________________________________________________________ +__________________________________________________________ + +RECIPE LIST + +1. [Chinese] MaLaXiangGuo +2. [Italian] Spaghetti +3. [Italian] Carbonara +4. [Chinese] Bejing Duck + +__________________________________________________________ +__________________________________________________________ + +Noted. I've removed this recipe: + [Italian] Carbonara +Now you have 3 recipes in the list. + +__________________________________________________________ +__________________________________________________________ + +RECIPE LIST + +1. [Chinese] MaLaXiangGuo +2. [Italian] Spaghetti +3. [Chinese] Bejing Duck + +__________________________________________________________ +__________________________________________________________ + +Got it. I've added this recipe: + [Chinese] XiaoLongBao +Now you have 4 recipes in the list. + +__________________________________________________________ +__________________________________________________________ + +Got it. I've added this recipe: + [Chinese] Guilinggao +Now you have 5 recipes in the list. + +__________________________________________________________ +__________________________________________________________ + +RECIPE LIST + +1. [Chinese] MaLaXiangGuo +2. [Italian] Spaghetti +3. [Chinese] Bejing Duck +4. [Chinese] XiaoLongBao +5. [Chinese] Guilinggao + +__________________________________________________________ +__________________________________________________________ +Here is the recipe you requested, which is a Chinese flavour: +name: MaLaXiangGuo +Here are 3 ingredients in the list: +1. Beef +2. Mutton +3. Mushrooms +__________________________________________________________ +__________________________________________________________ + +All recipes have been cleared! +__________________________________________________________ +__________________________________________________________ + +MATE! Your list is empty! + +__________________________________________________________ +__________________________________________________________ + Bye. Hope to see you again soon! __________________________________________________________ diff --git a/text-ui-test/input.txt b/text-ui-test/input.txt index a3abe50906..d60939de28 100644 --- a/text-ui-test/input.txt +++ b/text-ui-test/input.txt @@ -1 +1,19 @@ +list +add n/Hotpot i/Beef, Potatoes, Carrots t/Chinese +add n/MaLaXiangGuo i/Beef, Mutton, Mushrooms t/Chinese +list +add n/Spaghetti i/Pasta, Tomato Sauce, Cheese t/Italian +add n/Carbonara i/Pasta, Bacon, Egg, Cheese t/Italian +add n/Bejing Duck i/Duck, Pancakes t/Chinese +list +delete 1 +list +delete 3 +list +add n/XiaoLongBao i/Pork, Soup, Dumplings t/Chinese +add n/Guilinggao i/Tea, Milk, Sugar t/Chinese +list +view 1 +clear +list exit