Introducir datos por teclado
Publicado por Arnol (2 intervenciones) el 17/05/2017 01:39:32
Hola Buenas noches escribo para hacer la siguiente consulta, como introducir los datos por teclado en el siguiente código..
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
public static double Newton_Raphson_Modificado(double x0, double T)
{
int i =0;
double x = x0;
while(Math.abs(f(x)) > T)
{
System.out.println("Iteracion " + i++ + " " + x + " " + f(x));
x = x - (f(x)*df(x))/(df(x)*df(x) - f(x)*ddf(x));
}
System.out.println("Iteracion " + i++ + " " + x + " " + f(x));
return x;
}
public static double f(double x)
{
return (x*x*x - 5.0*x*x + 7.0*x - 3.0);
}
public static double df(double x)
{
return (3.0*x*x - 10.0*x + 7.0);
}
public static double ddf(double x)
{
return (6.0*x - 10.0);
}
Valora esta pregunta
0