Advertisement
Guest User

Currency_Convertor_Real

a guest
Jan 17th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 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 Money_Convertor
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double Salary = double.Parse(Console.ReadLine());
  14.             string StartingCurrency = Console.ReadLine();
  15.             string EndingCurrency = Console.ReadLine();
  16.             if (StartingCurrency == "USD")
  17.             {
  18.                 Salary *= 1.79549;
  19.             }
  20.             if (StartingCurrency == "EUR")
  21.             {
  22.                 Salary *= 1.95583;
  23.             }
  24.             if (StartingCurrency == "GBP")
  25.             {
  26.                 Salary *= 2.53405;
  27.             }
  28.             if (EndingCurrency == "USD")
  29.             {
  30.                 Salary /= 1.79549;
  31.             }
  32.             if (EndingCurrency == "EUR")
  33.             {
  34.                 Salary /= 1.95583;
  35.             }
  36.             if (EndingCurrency == "GBP")
  37.             {
  38.                 Salary /= 2.53405;
  39.             }
  40.  
  41.             Console.WriteLine(Math.Round(Salary, 2) + EndingCurrency);
  42.         }
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement