Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Test
- {
- class CurrencyConverter
- {
- static void Main(string[] args)
- {
- decimal BGN = 1.0M;
- decimal USD = 1.79549M;
- decimal EUR = 1.95583M;
- decimal GBP = 2.53405M;
- decimal value = decimal.Parse(Console.ReadLine());
- string inputCurrency = Console.ReadLine();
- string outputCurrency = Console.ReadLine();
- switch(inputCurrency)
- {
- case "BGN":
- break;
- case "USD":
- value = ( value * USD );
- break;
- case "EUR":
- value = ( value * EUR );
- break;
- case "GBP":
- value = ( value * GBP );
- break;
- default:
- break;
- }
- switch(outputCurrency)
- {
- case "BGN":
- value = value / BGN;
- break;
- case "USD":
- value = value / USD;
- break;
- case "EUR":
- value = value / EUR;
- break;
- case "GBP":
- value = value / GBP;
- break;
- default:
- break;
- }
- Console.WriteLine("{0:F2} {1}", value, outputCurrency);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement