Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _12.CurrencyConverter
- {
- class Program
- {
- static void Main(string[] args)
- {
- double money = double.Parse(Console.ReadLine());
- string input = Console.ReadLine();
- string output = Console.ReadLine();
- double lev = 1.0;
- double dollar = 1.79549;
- double evro = 1.95583;
- double pound = 2.53405;
- switch (input)
- {
- case "BGN":
- break;
- case "USD":
- money = money * dollar;
- break;
- case "EUR":
- money = money * evro;
- break;
- case "GBP":
- money = money * pound;
- break;
- default:
- break;
- }
- switch (output)
- {
- case "BGN":
- money = money / lev;
- break;
- case "USD":
- money = money / dollar;
- break;
- case "EUR":
- money = money / evro;
- break;
- case "GBP":
- money = money / pound;
- break;
- default:
- break;
- }
- Console.WriteLine(Math.Round (money, 2) + " " + output);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement