Advertisement
Guest User

CurrencyConverter

a guest
Mar 24th, 2018
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace UnotConverter
  5. {
  6.     class Program
  7.     {
  8.         static void Main()
  9.         {
  10.             double currencyFrom = double.Parse(Console.ReadLine());
  11.             string input = Console.ReadLine();
  12.             string output = Console.ReadLine();
  13.  
  14.             var curencyConvert = new Dictionary<string, double>()
  15.             {
  16.                 {"BGN", 1},
  17.                 {"USD", 1.79549},
  18.                 {"EUR", 1.95583},
  19.                 {"GBP", 2.53405},
  20.             };
  21.  
  22.             double result = currencyFrom * curencyConvert[input] / curencyConvert[output];
  23.  
  24.             Console.WriteLine("{0:f2} {1}", result, output);
  25.         }
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement