示例#1
0
    private static void ConvertFrom(CurrencyConverter currencyConverter)
    {
        Console.WriteLine("Choose option:");
        Console.WriteLine("1: Convert to USD");
        Console.WriteLine("2: Convert to EUR");
        Console.WriteLine("3: Convert to RUB");

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

        Console.WriteLine("Enter amount");

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

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

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

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