The below code is for question
find q
if q= sinx+cos-e rasied to -y/
e raised to y+e raised to -y -2 cosx
where e =1 const
CODE
import java.util.*;
import java.lang.Math;
class calculation
{
String len,len1;
double x,x1,x2,x3,x4,x5,x6,y,y1,y2,result,result1,result2;
final int e=1;
void getdata()
{
Scanner in = new Scanner(System.in);
try
{
System.out.println("Enter the value of x");
len=in.nextLine();
x = Double.valueOf(len);
System.out.println("Enter the value of y");
len1=in.nextLine();
y=Double.valueOf(len1);
}
catch(Exception e)
{
System.out.println("Error input or output");
}
x1=Math.sin(x);
x2=Math.cos(x);
y1=Math.sin(y);
y2=Math.cos(y);
x3=Math.pow(e, y);
x4=Math.pow(e, (-y));
x5=x*x;
x6=Math.cos(x5);
result1=(x1+y1-x4);
result2=(x3+x4-(2*x2));
result=result1/result2;
}
}
public class Sum {
public static void main(String args[])
{
calculation c = new calculation();
c.getdata();
System.out.println("The answer is "+ c.result1);
System.out.println("The answer is "+c.result2);
System.out.println("The answer is final result "+c.result);
}
}
if user does some mathematical error then how to i find out
and give him the info