Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
using System;
class ChangeBuro
{
static void Main(string[] args)
{
double money = double.Parse(Console.ReadLine());
string currencyIn = Console.ReadLine();
string currencyOut = Console.ReadLine();
string currencyStr = currencyIn + currencyOut;
double usdTobgn = money * 1.79549;
double eurTobgn = money * 1.95583;
double gpbTobgn = money * 2.53405;
switch (currencyStr)
{
case "USDBGN":
Console.WriteLine(Math.Round(usdTobgn, 2) + " " + currencyOut);
break;
case "BGNUSD":
Console.WriteLine(Math.Round(usdTobgn * 1.79549, 2) + " " + currencyOut);
break;
case "EURBGN":
Console.WriteLine(Math.Round(eurTobgn, 2) + " " + currencyOut);
break;
case "BGNEUR":
Console.WriteLine(Math.Round(money / 1.95583, 2) + " " + currencyOut);
break;
case "GBPBGN":
Console.WriteLine(Math.Round(gpbTobgn, 2) + " " + currencyOut);
break;
case "BGNGBP":
Console.WriteLine(Math.Round(gpbTobgn * 2.53405, 2) + " " + currencyOut);
break;
case "EURGBP":
Console.WriteLine(Math.Round(eurTobgn / 2.53405, 2) + " " + currencyOut);
break;
case "GBPEUR":
Console.WriteLine(Math.Round(gpbTobgn / 1.95583, 2) + " " + currencyOut);
break;
case "EURUSD":
Console.WriteLine(Math.Round(eurTobgn / 1.79549, 2) + " " + currencyOut);
break;
case "USDEUR":
Console.WriteLine(Math.Round(usdTobgn / 1.95583, 2) + " " + currencyOut);
break;
case "GBPUSD":
Console.WriteLine(Math.Round(gpbTobgn / 1.79549, 2) + " " + currencyOut);
break;
case "USDGBP":
Console.WriteLine(Math.Round(usdTobgn / 2.53405, 2) + " " + currencyOut);
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.