Simple question, but no answer yet.

import java.util.*;

publicclass Voorbeeld{

publicstaticvoid main(String[] args){

// TODO code application logic here

Scanner kb =new Scanner(System.in);

System.out.println("Kies de gewenste munt voor omrekening: e(Euro),s(Dollar)");

String x = kb.nextLine();

if (x.equals("e"))

System.out.println("Voer het gewenste bedrag in Euro in:");

else

System.out.println("Voer het gewenste bedrag in Dollar in:");

int a = kb.nextInt();

int b;

if (x.equals("e"))

{ ( a*1.2119) = b;

System.out.println("Het door u gekozen bedrag in Euro was: €"+a);

}

else System.out.println("Het door u gekozen bedrag in Dollar was: $"+a);

The problem is in after the last "if" expression.

I want to give b the value a*1.2119 but it says unexpected type, any ideas?

I'm trying to make a simple Euro-Dollar converter.

Greetigs Jordy

[1685 byte] By [Kukiwona] at [2007-11-26 18:12:23]
# 1
a is an integer make it a double, and do the same for b. -Bz
Bz_Unknowna at 2007-7-9 5:45:12 > top of Java-index,Java Essentials,New To Java...
# 2
Also, assignment is not symmetric:( a*1.2119) = b; //wrongb = a*1.2119; //right
DrLaszloJamfa at 2007-7-9 5:45:12 > top of Java-index,Java Essentials,New To Java...
# 3
Nope, the same problem, is the way i defined b right?Greetings
Kukiwona at 2007-7-9 5:45:12 > top of Java-index,Java Essentials,New To Java...
# 4
make sure you check your code you are doing x.equals("e") twice-Bz
Bz_Unknowna at 2007-7-9 5:45:12 > top of Java-index,Java Essentials,New To Java...
# 5
> ( a*1.2119) = b;This isn't correct Java syntax. You should reverse that:b= a*1.2119;... but then variable 'b' should have type double.kind regards,Jos
JosAHa at 2007-7-9 5:45:12 > top of Java-index,Java Essentials,New To Java...
# 6
Thanks very much, indeed i had to change it to b = a*1,2119Thanks very much,God i feel so stupid!:DGreetings
Kukiwona at 2007-7-9 5:45:12 > top of Java-index,Java Essentials,New To Java...