Java Валутен калкулатор
private static final double EUR = 1.95583; private static final double GBP = 2.53405; private static final double USD = 1.79549; private static final double BGN = 1; public static void main(String[] args) { Scanner console = new Scanner(System.in); double EUR = 1.95583; double GBP = 2.53405; double USD = 1.79549; double BGN = 1; double a = Double.valueOf(console.nextLine()); String b = console.nextLine(); String c = console.nextLine(); double kursValutaB = getExchangeRate(b); double kursValutaC = getExchangeRate(c); double result = a * kursValutaB / kursValutaC; System.out.println(String.valueOf(result) + c); } private static double getExchangeRate(String kodValuta) { if(kodValuta.equals("USD")) { return USD; } if(kodValuta.equals("GBP")) { return GBP; } if(kodValuta.equals("EUR")) { return EUR; } return BGN; } } }
Излиза ми тази грешка
Error:(40, 1) java: class, interface, or enum expected