-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patht03.java
More file actions
27 lines (22 loc) · 710 Bytes
/
t03.java
File metadata and controls
27 lines (22 loc) · 710 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
import java.util.Scanner;
public class t03 {
public static void main (String [] args){
Scanner sc = new Scanner(System.in);
System.out.println("Calculation for F(x) = tg(2x)-3 on [a,b] with step h");
System.out.println("Enter a: ");
double a = sc.nextDouble();
System.out.println("Enter b:");
double b = sc.nextDouble();
System.out.println("Enter h:");
double h = sc.nextDouble();
double x = a;
double result;
System.out.println(" X | F(x) ");
while (x<=b & x!=b)
{
result = Math.tan(2*x)-3;
System.out.println(x + " | "+ result);
x = x+h;
}
}
}