I need help putting the codes together to make a functioning program in Netbeans and doing api FOR THE JAVADOC

1 answer below »
I need help putting the codes together to make a functioning program in Netbeans and doing api FOR THE JAVADOC


class SteppingStone5_Recipe { private String recipeName; private int cookingTime; public SteppingStone5_Recipe(String recipeName, int cookingTime) { super(); this.recipeName = recipeName; this.cookingTime = cookingTime; } public int getCookingTime() { return cookingTime; } public void setRacipeName(String recipeName) { this.recipeName = recipeName; } public void printRecipe() { System.out.println(recipeName+" cooked in "+ cookingTime+" hour"); } public String getRecipeName() { return recipeName; } } public class SteppingStone6_RecipeBox { private static ArrayList recipes; public static void main(String[] args) { Scanner scan = new Scanner(System.in); recipes = new ArrayList<>(); int choice; do { menu(); choice = scan.nextInt(); switch (choice) { case 1: addRecipe(); break; case 2: printAllRecipeDetail(); break; case 3: printAllRecipeNames(); break; case 4: break; default: System.out.println("Invalid choice! Try Again..."); break; } } while (choice != 4); } private static void printAllRecipeNames() { for (SteppingStone5_Recipe steppingStone5_Recipe : recipes) { System.out.println(steppingStone5_Recipe.getRecipeName()); } } private static void printAllRecipeDetail() { Scanner scanner = new Scanner(System.in); System.out.print("Enter recipe name: "); String recipeName = scanner.nextLine(); int flag = 0; for (SteppingStone5_Recipe steppingStone5_Recipe : recipes) { if(steppingStone5_Recipe.getRecipeName().equalsIgnoreCase(recipeName)) { steppingStone5_Recipe.printRecipe(); flag = 1; } } if (flag ==0) { System.out.println("No Recipe found!"); } } private static void addRecipe() { Scanner scan = new Scanner(System.in); System.out.print("Enter Recipe name: "); String recipeName = scan.nextLine(); System.out.print("Enter cooking time: "); int cookingTime = scan.nextInt(); recipes.add(new SteppingStone5_Recipe(recipeName,cookingTime)); } public static void menu() { System.out.println("Menu\n" + "1. Add Recipe\n" + "2. Print All Recipe Details\n" + "3. Print All Recipe Names\n"+"4. Exit\n" + "\nPlease select a menu item:"); } } IT 511 Final Project Guidelines and Rubric
Answered 1 days AfterAug 04, 2022

Answer To: I need help putting the codes together to make a functioning program in Netbeans and doing api FOR...

Aditya answered on Aug 06 2022
63 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here