Question: if the input is 3 . 9 X 2 . 5 what is the output? import java.util.Scanner; import java.util.InputMismatchException; public class VoltageLevelsExceptHandling { public static
if the input is X what is the output? import java.util.Scanner;
import java.util.InputMismatchException;
public class VoltageLevelsExceptHandling
public static void mainString args
Scanner scnr new ScannerSystemin;
double voltageLevel;
while scnrhasNext
try
voltageLevel scnrnextDouble;
if voltageLevel
System.out.printlnon;
else if voltageLevel && voltageLevel
System.out.printlnoff;
else
System.out.println;
catch InputMismatchException excpt
System.out.printlnError getting input";
scnrnext;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
