-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab2.java
More file actions
32 lines (27 loc) · 798 Bytes
/
Lab2.java
File metadata and controls
32 lines (27 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import java.util.Scanner;
import static java.lang.Math.*;
public class Lab2 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int x;
double total;
x = scanner.nextInt();
if (x<-1){
total = part1(x);
} else if (x>=-1 && x<1){
total = part2(x);
} else {
total = part3(x);
}
System.out.print(total);
}
private static double part1(int variable){
return pow(variable, 6)*log(abs(pow(6, variable)-abs(pow(variable-5, variable))));
}
public static double part2(int variable){
return sin(variable/(1-2*pow(variable, 2)));
}
public static double part3(int variable){
return asin(1/pow(variable, 4));
}
}