Конвертор за валута
Проблем със конвертора за валута. Джаджа изкарва 80/100. Какъв е проблема?
import java.util.Scanner; public class Convertor { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double mony = Double.parseDouble(scanner.nextLine()); String valuta1 = scanner.nextLine(); String valuta2 = scanner.nextLine(); double totalMony = 0.0; if (valuta1.equals("USD") && valuta2.equals("BGN") ){ totalMony = mony * 1.79549; } else if (valuta1.equals("BGN") && valuta2.equals("EUR") ) { totalMony = mony / 1.95583; } else if (valuta1.equals("EUR") && valuta2.equals("GBP") ){ totalMony = (mony * 1.95583)/2.53405; } else if (valuta1.equals("USD") && valuta2.equals("EUR") ){ totalMony = (mony * 1.79549)/1.95583; } System.out.printf( "%.2f%n", totalMony); System.out.println(valuta2); } }