// JOSÉ ROMERO
//ING. MECATRÓNICA 3 "B"
double valorX;
public double f2(double x){
valorX = x;
double f;
if (valorX<0){
f = x*x;
System.out.println("Respuesta = "+f);
}
if ((valorX>=0)||(valorX<1))>
return f;
}
public static void main(String[] args) {
Funciones fun =new Funciones();
System.out.println(fun.f2(-2));
System.out.println(fun.f2(0.5));
System.out.println(fun.f2(2));
}
}
f= Math.sqrt(x);
else{
f= x*(Math.sqrt(x));
}
else{
f= x*(Math.sqrt(x));
}
return f;
}
public static void main(String[] args) {
Funciones fun =new Funciones();
System.out.println(fun.f2(-2));
System.out.println(fun.f2(0.5));
System.out.println(fun.f2(2));
}
}
1 comentario:
el debeer esta bien hecho pero podias hacerlo mas facil utilizando lo que vimos en clases
Publicar un comentario