Question
What is the output if 1. The value of lowerLimit is 50 and the value of divisor is 10? 2. The value of lowerLimit is
What is the output if
1. The value of lowerLimit is 50 and the value of divisor is 10?
2. The value of lowerLimit is 50 and the value of divisor is 0?
3. The value of the lowerLimit is 150 and the value of divisor is 10?
4. The value of lowerLimit is 150 and the value of divisor is 0?
***
Public static void main(String[] args){
scanner console = new scanner(System.in);
int lowerLimit, divisor, result;
try{
lowerLimit = console.nextInt();
divisor = console.nextInt();
result = lowerLimit/divisor;
if (lowerLimit < 100)
throw new Exception(Lower limit violation.);
System.out.println(result = + result);
}
catch (Exception e) {
System.out.println(Exception: + e.toString());
}
}
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