Question: Do you see anything wrong in this code? in thosen't work well it returns a NaN.

```
public class Method2 extends GUIct1
{
double x=0,y=0;

void settype1 (double conv1)
{
x = conv1;
}

void settype2 (double conv2)
{
y = conv2;
}

double conversion ( double amount)
{

double converted = (amount*y)/x;
    return converted;
}

}

```

Way it is used an i already changed the set part

```
Method2 convert = new Method2(); \\ method is called

```

.....

```
convert.settype1(j);

```

.....

```
convert.settype2(k);

```

.....

```
double x = convert.conversion(i);
System.out.println(x);

```

Answer: 
It doesn't look like you ever call gettype1 or gettype2 so the x/y is 0/0 resulting in NaN
This can happen when x=0. Division by zero is not defined. Print out x and y before you start to calculate to see whetther they are not zero.