Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- /**
- * Created by Ivaylo on 24.4.2017 г..
- */
- public class Multi {
- public static void main(String[] args) {
- Scanner scan = new Scanner(System.in);
- double moneyTostring = Double.parseDouble(scan.nextLine());
- String firstCurrency = scan.nextLine();
- String secondCurrency = scan.nextLine();
- double BGN = 1;
- double USD = 1.79549;
- double EUR = 1.95583;
- double GBP = 2.53405;
- if (firstCurrency.equals("BGN")) {
- if (secondCurrency.equals("USD")) {
- System.out.printf("%.2f", BGN / USD * moneyTostring);
- } else if (secondCurrency.equals("EUR")) {
- System.out.printf("%.2f", BGN / EUR * moneyTostring);
- } else if (secondCurrency.equals("GBP")) {
- System.out.printf("%.2f", BGN / GBP * moneyTostring);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement