Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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)

image text in transcribed

at java.util.Scanner.next(Scanner.java:1485)

image text in transcribed

at java.util.Scanner.nextFloat(Scanner.java:2345)

image text in transcribed

at SteppingStones.SteppingStone5_Recipe.createNewRecipe(SteppingStone5_Recipe.java:210)

image text in transcribed

at SteppingStone6_RecipeBox.addNewRecipe(SteppingStone6_RecipeBox.java:86)

image text in transcribed

at SteppingStone6_RecipeBox.main(SteppingStone6_RecipeBox.java:100)

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

Students also viewed these Databases questions

Question

LO5 Illustrate the steps in developing a base pay system.

Answered: 1 week ago

Question

LO3 Outline strategic compensation decisions.

Answered: 1 week ago