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.CurrencyConvertor2
- {
- class Program
- {
- static void Main(string[] args)
- {
- var amount = double.Parse(Console.ReadLine());
- var currency1 = Console.ReadLine();
- var currency2 = Console.ReadLine();
- var val1 = 0.0;
- var val2 = 0.0;
- switch (currency1)
- {
- case "BGN":
- val1 = 1.0;
- break;
- case "USD":
- val1 = 1.79549;
- break;
- case "EUR":
- val1 = 1.95583;
- break;
- case "GBP":
- val1 = 2.53405;
- break;
- }
- switch (currency2)
- {
- case "BGN":
- val2 = 1.0;
- break;
- case "USD":
- val2 = 1.79549;
- break;
- case "EUR":
- val2 = 1.95583;
- break;
- case "GBP":
- val2 = 2.53405;
- break;
- }
- var result = val1 / val2 * amount;
- Console.WriteLine("{0:f2} {1}", result, currency2);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement