My code have a simple error but i dont know how to solve it !!!
ImageShack® - Online Photo and Video Hosting
Imageshack - erronobluej.jpg
==========================//====================
Code Java:
public class Bhaskara {
int a;
int b;
int c;
int d;
double x;
double x2;
public Bhaskara () {
a=1;
b=1;
c=1;
d=1;
}
public void seta ( int a );
{
valor_a=a;
}
public void setx ( double x );
{
valor_x=x;
}
public void setx2 ( double x2 );
{
valor_x2=x2;
}
public void setb ( int b );
{
valor_b=b;
}
public void setc ( int c );
{
valor_c=c;
}
int d = b*b- (4*a*c);
void apply () {
if (d = 0)
public double xvalue;
x = -b + Math.pow (d;1/2)/2*a;
return x;
else (d < 0)
public staticm void main ( string args [] ) {
System.out.println ("There'so possible answer");
}
else ( d > 0 )
public double xvalue;
x = -b + Math.pow (d;1/2)/2*a;
return x;
public double x2value;
x2 = -b - Math.pow (d;1/2)/2*a;
return x2;
}
Re: My code have a simple error but i dont know how to solve it !!!
Those images are too small to see the errors.
What seems to be the problem exactly? Please give us as much detail as possible.
Looking at the code, I can see lot's of errors straight away. I suggest going back to basics - The Java™ Tutorials
My first hint would be to look at the methods.
Re: My code have a simple error but i dont know how to solve it !!!
Code Java:
void apply () {
if (d = 0)
public double xvalue;
x = -b + Math.pow (d;1/2)/2*a;
return x;
The error says : " illegal start of expression " in public double x value
Re: My code have a simple error but i dont know how to solve it !!!
Like I said, there are lots of errors in your code.
- Your methods are wrong. Delete ;
- d is a duplicate variable.
- valor_a, valor_b etc are undefined.
Plus x = -b + Math.pow (d;1/2)/2*a; is completely wrong.
Re: My code have a simple error but i dont know how to solve it !!!
Im using BlueJ.... i think its kinda different
Re: My code have a simple error but i dont know how to solve it !!!
Different from what? The syntax is the same, right?
Re: My code have a simple error but i dont know how to solve it !!!
Quote:
Originally Posted by
Java Neil
Different from what? The syntax is the same, right?
im not sure, it just shoed that error and that i should put ; at the end of each command