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 CurrencyConverter
- {
- class CurrencyConverter
- {
- static void Main(string[] args)
- {
- var size = double.Parse(Console.ReadLine());
- var inCurrency = Console.ReadLine().ToUpper();
- var outCurrency = Console.ReadLine().ToUpper();
- if (inCurrency == "USD")
- {
- size = size * 1.79549;
- }
- else if (inCurrency == "EUR")
- {
- size = size * 1.95583;
- }
- else if (inCurrency == "GBP")
- {
- size = size * 2.53405;
- }
- else if (inCurrency == "BGN")
- {
- size = size;
- }
- if (outCurrency == "USD")
- {
- size = size / 1.79549;
- }
- else if (outCurrency == "EUR")
- {
- size = size / 1.95583;
- }
- else if (outCurrency == "GBP")
- {
- size = size / 2.53405;
- }
- else if (outCurrency == "BGN")
- {
- size = size;
- }
- Console.WriteLine("{0:F2} {1}", size, outCurrency);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement