Question: in this program, the only way it will work if the equaiton is spaced out. TO recieve extra credit. i need to alter the program



in this program, the only way it will work if the equaiton is spaced out. TO recieve extra credit. i need to alter the program to where it doesnt have to have spaces in the users equation
Scanner kbd - new Scanner (System.in); System.out.println( "Equation: ");//declaring three seperate variables int firstInt-kbd.nextInt(); String secondPlace-kbd.next); int secondInt-kbd.nextInt(); DecimalFormat numberFormat - new DecimalFormat ("#.ee"); if (secondInt!-e)(//starting off by seeing if user is try to divide by zero switch (secondPlace)//else start calculatons case "+" System.out.print (firstInt + " + " + secondInt-. ");//equation for additon System.out.println(firstInt+secondInt); break
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
