Skip to content

Instantly share code, notes, and snippets.

@NastySwipy
Last active February 13, 2017 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NastySwipy/a0b92890305dfe72f8b86d529f2b612b to your computer and use it in GitHub Desktop.
Save NastySwipy/a0b92890305dfe72f8b86d529f2b612b to your computer and use it in GitHub Desktop.
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