Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void addRecipe() {
- Scanner newRecipeInput = new Scanner(System.in);
- System.out.println("Enter the new Recipe's name: ");
- String newRecipeName = newRecipeInput.nextLine();
- // ensure new Recipe name does not already exist
- for (Recipe eachRecipe: recipeList) {
- if (eachRecipe.getRecipeName().equalsIgnoreCase(newRecipeName)) {
- System.out.println("That recipe is already entered. Exiting to prompt...");
- return; // quits addRecipe() method processing
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement