Question
Java help needed with exceptions. I've written a recipe program and when I get to the point where I would enter the amount of an
Java help needed with exceptions. I've written a recipe program and when I get to the point where I would enter the amount of an ingredient, I get the list of exceptions pictured below:
Clicking each one of these will take me to a highlighted section of the code and I need some help figuring out what needs to be done. In order, here are parts of the code from that list:
at java.util.Scanner.throwFor(Scanner.java:864)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextFloat(Scanner.java:2345)
at SteppingStones.SteppingStone5_Recipe.createNewRecipe(SteppingStone5_Recipe.java:210)
at SteppingStone6_RecipeBox.addNewRecipe(SteppingStone6_RecipeBox.java:86)
at SteppingStone6_RecipeBox.main(SteppingStone6_RecipeBox.java:100)
myRecipeBox.printAllRecipeDetails (selectedRecipeName) SteppingStone6-Rec peBox > main > do while (men Sc r.ha Nextint ll menuSc r.ha NextLine ) > if nput == 1) > arch Results Analyzer Outputx Debugger Console it511 (run) #2 x 2 slices of bread Please enter the ingredient amount: Exception in thread "main" java.util. InputHismatchException at java.util.Scanner.throwFor (Scanner.java: 864) at java.util.Scanner.next (Scanner.java: 1485) at java.util.Scanner nextFloat (Scanner.java: 2345) at SteppingStones.SteppingStone5_Recipe.createNewRecipe (SteppingStone5 Recipe.java: 210) at SteppingStone6_RecipeBox. addNewRecipe (SteppingStone6 RecipeBox.java:86) at SteppingStone 6RecipeBox.main (SteppingStone RecipeBoxjava:100) Java Result: 1 BUILD SUCCESSFUL (total time: 34 seconds)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started