Advertisement
svetoslav_0

CurrConvertor

Jan 13th, 2018
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace SimpleCalcs
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var input = double.Parse(Console.ReadLine());
  14.             string CurrInput = Console.ReadLine();
  15.             string CurrOutput = Console.ReadLine();
  16.             if (CurrInput == "USD")
  17.             {
  18.                 input = input * 1.79549;
  19.             }
  20.             else if (CurrInput == "EUR")
  21.             {
  22.                 input = input * 1.95583;
  23.             }
  24.             else if (CurrInput == "GBP")
  25.             {
  26.                 input = input * 2.53405;
  27.             }
  28.             else if (CurrInput == "BGN")
  29.             {
  30.                 input = input * 1.0;
  31.             }
  32.             if (CurrOutput == "BGN")
  33.             {
  34.                 input = input / 1.0;
  35.             }
  36.             else if (CurrOutput == "USD")
  37.             {
  38.                 input = input / 1.79549;
  39.             }
  40.             else if (CurrOutput == "EUR")
  41.             {
  42.                 input = input / 1.95583;
  43.             }
  44.             else if (CurrOutput == "GBP")
  45.             {
  46.                 input = input / 2.53405;
  47.             }
  48.             Console.WriteLine(Math.Round(input,2) + " " + CurrOutput);
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement