import java.util.ArrayList; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ public class SteppingStone5_RecipeTest { /** * @param args the command line arguments */ public static void main(String[] args) { // Create two recipe objects first SteppingStone5_Recipe myFirstRecipe = new SteppingStone5_Recipe(); ArrayList recipeIngredients = new ArrayList(); ArrayList recipeIngredientsTwo = new ArrayList(); String ingredientName = "Anchovies"; Ingredient tempIngredient = new Ingredient().addNewIngredient(ingredientName); recipeIngredients.add(tempIngredient); SteppingStone5_Recipe mySecondRecipe = new SteppingStone5_Recipe("Pizza", 2, recipeIngredients, 300); // Initialize first recipe String ingredientNameTwo = "Noodles"; Ingredient tempIngredientTwo = new Ingredient().addNewIngredient(ingredientNameTwo); recipeIngredientsTwo.add(tempIngredientTwo); myFirstRecipe.setRecipeName("Ramen"); myFirstRecipe.setServings(2); myFirstRecipe.setRecipeIngredients(recipeIngredientsTwo); myFirstRecipe.setTotalRecipeCalories(150); } } // Print details of both recipes myFirstRecipe.printRecipe(); mySecondRecipe.printRecipe(); import SteppingStones.Ingredient; import java.util.ArrayList; import java.util.Scanner; /** * @author snhu.edu */ public class SteppingStone5_Recipe { /* * Set up the variables with their mutators and constructors. * */ private String recipeName; private int servings; private ArrayList recipeIngredients = new ArrayList(); private double totalRecipeCalories; public SteppingStone5_Recipe() { this.recipeName = ""; this.servings = 0; // <--- assignment value with appropriate data type this.recipeIngredients = new ArrayList<>(); // <-- assignment value for empty ArrayList this.totalRecipeCalories = 0; } public SteppingStone5_Recipe(String recipeName, int servings, ArrayList recipeIngredients, double totalRecipeCalories) // <-- use appropriate data type for the ArrayList and the servings arguments { this.recipeName = recipeName; this.servings = servings; this.recipeIngredients = recipeIngredients; this.totalRecipeCalories = totalRecipeCalories; } /** * The following outputs have been created to generate the recipe name, * servings, and the total calories. * * @param createNewRecipe */ public static void main(String[] createNewRecipe) { double totalRecipeCalories = 0; ArrayList recipeIngredients = new ArrayList(); String ingredientName = "", unitMeasurement = ""; boolean addMoreIngredients = true; Scanner scnr = new Scanner(System.in); System.out.println("Please enter the recipe name: "); // correct data tup and Scanner assignment method used for recipeName variable. String recipeName = scnr.nextLine(); System.out.