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;
- namespace _12.CurrencyConverter
- {
- class Program
- {
- static void Main(string[] args)
- {
- double valueIn = double.Parse(Console.ReadLine());
- string currencyIn = Console.ReadLine();
- string currencyOut = Console.ReadLine();
- double valueBGN = 0;
- switch (currencyIn)
- {
- case "BGN": valueBGN = valueIn; break;
- case "USD": valueBGN = valueIn * 1.79549; break;
- case "EUR": valueBGN = valueIn * 1.95583; break;
- case "GBP": valueBGN = valueIn * 2.53405; break;
- }
- double valueOut = 0;
- switch (currencyOut)
- {
- case "BGN": valueOut = valueBGN; break;
- case "USD": valueOut = valueBGN / 1.79549; break;
- case "EUR": valueOut = valueBGN / 1.95583; break;
- case "GBP": valueOut = valueBGN / 2.53405; break;
- }
- Console.WriteLine($"{valueOut:F2} {currencyOut}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement