Good time of day! I'm working on creating an Eulers Method Calculator program. The problem I got stuck on is I don't know how to convert the user's string into a Differential Equation (dy/dx).
This is what I have so far:
import static java.lang.System.*;
import java.util.Scanner;
class EulersMethod {
public static void main(String args[]) {
double xcor, ycor, delx, dely, xcorplusdelx, ycorplusdely, fx;
String dydx;
Scanner input = new Scanner(System.in);
out.print(" Enter x coordinate ");
xcor = input.nextDouble();
out.print(" Enter y coordinate ");
ycor = input.nextDouble();
out.print(" Enter delta x ");
delx = input.nextDouble();
out.print(" Enter dy/dx ");
dydx = input.next();
out.print(" Enter x coordinate at which" +'\n'+ " you want to find the y value ");
fx = input.nextDouble();
while (xcor != fx)
}
}
Fot the dydx user input, the user can input different Differential Equations, such as (x, y, x+y, 2x+y,...) and so on. Thus I dont know how to convert those inputs into a calculations within the code. What advice could you give me in order to resolve my issue?