Question: This is not complete. Below is all that's missing. Can someone complete please? System.out.println(Please enter the recipe name: ); String recipeName = scnr.nextLine(); System.out.println(Please enter

This is not complete. Below is all that's missing. Can someone complete please?

System.out.println("Please enter the recipe name: ");

String recipeName = scnr.nextLine();

System.out.println("Please enter the number of servings: ");

//correct data type & Scanner assignment method for servings variable

???? servings = ????

do {

System.out.println("Please enter the ingredient name

or type end if you are finished entering ingredients: ");

String ingredientName = scnr.next();

if (ingredientName.toLowerCase().equals("end")) {

addMoreIngredients = false;

} else {

/**

* Add the ingredient name to recipeIngredients

*

*/

System.out.println("Please enter the ingredient amount: ");

float ingredientAmount = scnr.nextFloat();

System.out.println("Please enter the ingredient Calories: ");

int ingredientCalories = scnr.nextInt();

/**

* Add the total Calories from this ingredient

*(ingredientCalories * ingredientAmount)

* to the totalRecipeCalories

*

*/

}

} while (!reply.equals("n") ;

SteppingStone5_Recipe recipe1 = new SteppingStone5_Recipe(recipeName,

servings, recipeIngredients, totalRecipeCalories);

recipe1.printRecipe();

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!