Implement the following equation
3x4sin(180x) + 4x3cos(90x) + x2sin(tan(45)) + 7x + 9cos(90x2 )
Where x may be user defined value.
Java Language
import java.util.Scanner;
public class Main
{
public static void main (String[] args)
{
Scanner in = new Scanner(System.in);
System.out.println("Enter x:");
double x = in.nextDouble();
double result = 3 * Math.pow(x, 4) * Math.sin(180*x) + 4 * Math.pow(x, 3) * Math.cos(90*x) +
x*x * Math.sin(Math.tan(45)) + 7*x + 9 * Math.cos(90 * x*x);
System.out.println("Result of equation: " + result);
}
}
Comments
Leave a comment