When I run the following code I get chicken as an ingredient under my mac and cheese
Question:
When I run the following code I get chicken as an ingredient under my mac and cheese recipe and also get macaroni as an ingredient for my fried chicken recipe. I need help in reversing this order, what am I not seeing here? Thanks!
package SteppingStones;
import java.util.ArrayList;
public class RecipeTest {
/**
* @param args the command line arguments --- in case you use
*/
public static void main(String[] args) {
/* Creating first recipe object for Recipe class */
Recipe myFirstRecipe = new Recipe();
/* Creating array lists for first recipe ingredients */
ArrayList
/* Ingeredients that will be added */
String ingredientName = "Macaroni";
/* Adding ingredients for first recipe */
recipeIngredientsOne.add(ingredientName);
/* Creating second recipe object for Recipe class with parameters */
Recipe mySecondRecipe = new Recipe("Fried Chicken", 2, recipeIngredientsOne, 700);
/* Creating array lists for second recipe ingredients */
ArrayList
/* Ingeredients that will be added */
String ingredientName2 = "Chicken";
/* Adding ingredients for second recipe */
recipeIngredientsTwo.add(ingredientName2);
/* Calling mutators with the first recipe object */
myFirstRecipe.setRecipeName("Mac and Cheese");
myFirstRecipe.setServings(3);
myFirstRecipe.setRecipeIngredients(recipeIngredientsTwo);
myFirstRecipe.setTotalRecipeCalories(400);
// Print details of both recipes
myFirstRecipe.printRecipe();
mySecondRecipe.printRecipe();
}
}
Statistics And Data Analysis For Financial Engineering
ISBN: 9781461427490
1st Edition
Authors: David Ruppert