Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Globalization;
- namespace CurrencyConverter
- {
- class Program
- {
- static void Main()
- {
- double amountOfMoney = double.Parse(Console.ReadLine());
- string fromCurrency = Console.ReadLine();
- string toCurrency = Console.ReadLine();
- Dictionary<string, double> currencyValues = new Dictionary<string, double>
- {
- ["BGN"] = 1.0,
- ["USD"] = 1.79549,
- ["EUR"] = 1.95583,
- ["GBP"] = 2.53405,
- };
- double result = (currencyValues[fromCurrency] / currencyValues[toCurrency]) * amountOfMoney;
- Console.WriteLine($"{result:f2} {toCurrency}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement