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 CurrencyConverter
- {
- static void Main(string[] args)
- {
- double money = double.Parse(Console.ReadLine());
- string firstCurrency = Console.ReadLine();
- string secondCurrency = Console.ReadLine();
- double firstValue = 0.0;
- double secondValue = 0.0;
- if (firstCurrency == "BGN")
- {
- firstValue = 1.0;
- }
- else if (firstCurrency == "USD")
- {
- firstValue = 1.79549;
- }
- else if (firstCurrency == "EUR")
- {
- firstValue = 1.95583;
- }
- else if (firstCurrency == "GBP")
- {
- firstValue = 2.53405;
- }
- if (secondCurrency == "BGN")
- {
- secondValue = 1.0;
- }
- else if (secondCurrency == "USD")
- {
- secondValue = 1.79549;
- }
- else if (secondCurrency == "EUR")
- {
- secondValue = 1.95583;
- }
- else if (secondCurrency == "GBP")
- {
- secondValue = 2.53405;
- }
- double result = money * (firstValue / secondValue);
- Console.WriteLine("{0} {1}", Math.Round(result, 2), secondCurrency);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement