Question: Java. How can I fix my code to include a exception handler that deals with nonnumeric operands, ArithmeticException and any others that is required??? 1e

Java. How can I fix my code to include a exception handler that deals with nonnumeric operands, ArithmeticException and any others that is required???
 Java. How can I fix my code to include a exception
handler that deals with nonnumeric operands, ArithmeticException and any others that is

1e isport java.uti1.Scanner a 2 isport java.text.Decinalformat 4 public class Lab 7 ( private static Scanner ingut osus- ne Syste. out-Printin("Hai"-'); Systen.out.pristin("1s Addition") Syste" out-Pristin("2t Sulberertion"); System out . pristin("); matiplication"); System.out prist ?n(.4: Divisio.-); System.out.pristin"S: Exit") int userChoice System.out.printin( Enter a choice:) userchoice estint) uhile (usercholce 1-5) int secondius(int ) 0Math nandon) 10) switch (userchoice) ( Syste out printlefirstNn+secondu int addinginput if (addingiputadeing) nextint ) Systen.out.printle cerrect) Systen out.printie"Y else is wrng The correct anser is "adding) break case 21 ?nt sub-.ir,"Nan - see eedN.na systes out.pristin(firsthe esecond) Systes.out.pristin"cerrect) Systes out,pristinC Yeur swer is wrang. The correct answers+) else breaki case3 int sult firstNssecondn Systes.out.printl"correct) Systee.out.printin"Your answer is rong. The cerrect anseer is malt) else while (second // to sake sure the bottoe nusber 1s never e seconius-(int)Rath,roMath.rnde)1)) double di- firstum/secondu Systes.out printlnfstsc double divInput input.nextDeuble)a Systes.out.printin"corect") else "di) Systes.out.printla(Your answte is wrong The corect ansur s breakj case s System.exit()i break 73 default

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 Databases Questions!