Example #1
0
    private static void ConvertTo(CurrencyConverter currencyConverter)
    {
        Console.WriteLine("Choose option:");
        Console.WriteLine("1: Convert from USD");
        Console.WriteLine("2: Convert from EUR");
        Console.WriteLine("3: Convert from RUB");

        var option = int.Parse(Console.ReadLine());

        Console.WriteLine("Enter amount");

        var input = double.Parse(Console.ReadLine());

        switch (option)
        {
        case 1:
            Console.WriteLine(currencyConverter.ConvertFromUsd(input));
            break;

        case 2:
            Console.WriteLine(currencyConverter.ConvertFromEur(input));
            break;

        case 3:
            Console.WriteLine(currencyConverter.ConvertFromRub(input));
            break;
        }
    }