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 _09.Converter4MeasuringUnits
- {
- class Program
- {
- static void Main(string[] args)
- {
- var value = double.Parse(Console.ReadLine());
- var firstCurrency = Console.ReadLine();
- var secondCurrency = Console.ReadLine();
- var firstValue = 0d;
- var seconValue = 0d;
- var eu = 1.95583;
- var us = 1.79549;
- var gb = 2.53405;
- var bg = 1d;
- if (firstCurrency == "BGN")
- firstValue = bg;
- else if (firstCurrency == "USD")
- firstValue = us;
- else if (firstCurrency == "EUR")
- firstValue = eu;
- else if (firstCurrency == "GBP")
- firstValue = gb;
- if (secondCurrency == "BGN")
- seconValue = bg;
- else if (secondCurrency == "USD")
- seconValue = us;
- else if (secondCurrency == "EUR")
- seconValue = eu;
- else if (secondCurrency == "GBP")
- seconValue = gb;
- var result = value * (firstValue / seconValue);
- Console.WriteLine(Math.Round(result, 2));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement