double Euro = 1.37;
double USAD = 1.81;
double JapYen = 190.00;
double Zloty = 5.88;
//First menu choice screen
if (MenuChoice == 1) {
System.out.println("Which of the following currencies do you wish to exchange into sterling?");
System.out.println("Euro - EUR");
System.out.println("USA Dollar - USD");
System.out.println("Japanese Yen - JPY");
System.out.println("Polish Zloty - PLN");
System.out.print("Please enter the three letter currency: ");
//Currency input validation
String CurChoice = "";
boolean isCorrectCurrency = false;
do {
CurChoice = keybStr.next();
isCorrectCurrency = CurChoice.matches("^EUR|USD|JPY|PLN$");
if (isCorrectCurrency) {
System.out.println("");
} else {
System.out.print("Invalid Currency Entered. Please Retry: ");
}
} while (!isCorrectCurrency);
//Exchange amount calculator
System.out.print("Enter the amount you wish to exchange of " + CurChoice + ": ");
double ExcAmount = keybStr.nextInt();
if (CurChoice == "EUR") {
double result = ExcAmount / Euro;
System.out.println(ExcAmount + " in " + CurChoice + " = £" + result);
} else if (CurChoice == "USD") {
double result = ExcAmount / USAD;
System.out.println(ExcAmount + " in " + CurChoice + " = £" + result);
} else if (CurChoice == "JPY") {
double result = ExcAmount / JapYen;
System.out.println(ExcAmount + " in " + CurChoice + " = £" + result);
} else if (CurChoice == "PLN") {
double result = ExcAmount / Zloty;
System.out.println(ExcAmount + " in " + CurChoice + " = £" + result);
} else {
System.out.println("");
}
}//if
So this is what I got so far. I want the code to say (as an example) "500.00 in EUR = £364.96" though when I run the code it just ends after the user inputs which currency they wish to use. Any help? I wasn't sure whether i needed to put the if statement within a loop or something.