This class determines the logarithm of a number public clas

// This class determines the logarithm of a number
public class DebugTwelve1
{
public static void main(String[] args) throws ArithmeticException
{
double num = -8.8, result;
try
{
if(num <= 0)
throw(new ArithmeticException());
result = Math.log(num);
System.out.println(\"Result is \" + result);
}
catch()
{
System.out.println(\"Can\'t take logarithm for value of zero or lower\");
}
}
}

Solution

//In this problem your question is not clear.so I will provide you the easier approach

//This is an easier way

//program which finds the logarithm of a number base 10 in java

// This class determines the logarithm of a number public class DebugTwelve1 { public static void main(String[] args) throws ArithmeticException { double num =

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site