Advertisement
NikolaySpasovTriset

Currency_Converter

Sep 2nd, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.33 KB | None | 0 0
  1. using System;
  2.  
  3. class Currency_Converter
  4. {
  5.     static void Main()
  6.     {
  7.         var USD = 1.79549;
  8.         var EUR = 1.95583;
  9.         var GBP = 2.53405;
  10.         var x = double.Parse(Console.ReadLine());
  11.         var firstCurency = Console.ReadLine();
  12.         var secondCurrency = Console.ReadLine();
  13.         var moneyInleva = 0.00;
  14.  
  15.         if (firstCurency == "USD")
  16.             {
  17.             moneyInleva = x * USD;
  18.             }
  19.         else if (firstCurency == "EUR")
  20.             {
  21.             moneyInleva = x * EUR;
  22.             }
  23.         else if (firstCurency == "GBP")
  24.             {
  25.             moneyInleva = x * GBP;
  26.             }
  27.         else if (firstCurency == "BGN")
  28.             {
  29.                 moneyInleva = x;
  30.             }
  31.  
  32.  
  33.         var MoneyInWanted = 0.00;
  34.  
  35.         if (secondCurrency == "USD")
  36.             {
  37.             MoneyInWanted = moneyInleva / USD;
  38.             }
  39.         else if (secondCurrency == "EUR")
  40.             {
  41.             MoneyInWanted = moneyInleva / EUR;
  42.             }
  43.         else if (secondCurrency == "GBP")
  44.             {
  45.             MoneyInWanted = moneyInleva / GBP;
  46.             }
  47.         else if (secondCurrency == "BGN")
  48.             {
  49.             MoneyInWanted = moneyInleva;
  50.             }
  51.  
  52.         Console.WriteLine("{0:0.00} {1}", MoneyInWanted, secondCurrency);
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement