Advertisement
Guest User

Untitled

a guest
Oct 18th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. public static void addRecipe() {
  2.  
  3. Scanner newRecipeInput = new Scanner(System.in);
  4. System.out.println("Enter the new Recipe's name: ");
  5. String newRecipeName = newRecipeInput.nextLine();
  6.  
  7. // ensure new Recipe name does not already exist
  8. for (Recipe eachRecipe: recipeList) {
  9. if (eachRecipe.getRecipeName().equalsIgnoreCase(newRecipeName)) {
  10. System.out.println("That recipe is already entered. Exiting to prompt...");
  11. return; // quits addRecipe() method processing
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement