Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What is output? public class MathOps { public static int divOp ( int num, int denom ) throws Exception { if ( denom = =
What is output?
public class MathOps
public static int divOpint num, int denom throws Exception
if denom
throw new ExceptionInvalid div input";
return num denom;
public static double sqrtOpdouble num throws Exception
if num
throw new ExceptionInvalid sqrt input";
return Math.sqrtnum;
public static void mainString args
try
int x;
int y;
x ;
y ;
System.out.printlndivOpx y;
System.out.printlnsqrtOpdoubley;
catch Exception excpt
System.out.printlnexcptgetMessage;
System.out.printlnCannot compute operation";
a
Invalid div input
Invalid sqrt input
b
Invalid div input
Cannot compute operation
c
Invalid div input
Invalid sqrt input
Cannot compute operation
d
Cannot compute operation
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