I dont feel like making an actual tutorial right now so i thought i'd show how to do something simple.
In this one, our equation will be... X=3y*2 where y=8.
Like i said, extremely simple
, but this works with every algebra prob. When you start working with trig/calculus, Its a bit different to code and you have to import some other classes.
But yea, I'll get to that in a tutorial in maybeh a few weeks. Even though i doubt anyone here actually needs to do that e.e
But in order to do that, Just open DrJava.
In the main code section, put
- Code:
-
class AlgebraTut{
public static void main(String[] args){
int b = 3;
int y = 8;
int x = b*y;
int f = x*2;
System.out.println("x=3y*2="+f);
}
}
I dont have the time right now to say what it means in length, BUT
Basically, Since the equation was x=3y*2, You just set variables, int stands for integer, You're setting b to 3, y to 8. then, you're setting x to b multiplied by y(3*8 for 3y), once you get that, you're setting f to x*2, which is really (3*
(2). Thats it :], then, you see i put the actual "equation" in quotes, and then put +f beside it, that way it prints out the variable f next to the equation to give it the look of the equation actually being worked out
.
I PLAN on eventually putting up some tutorials where you dont actually have to code it over and over again, where you just set variables and allow the user to set the values for the variables and the program do its thang :]
But, that will be a few days, up to 2 weeks. lol