Advertisement
grigorb57

Currency Converter 2

Feb 1st, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 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 ConsoleApp17
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double sum = double.Parse(Console.ReadLine());
  14.  
  15. string inputCurrency = Console.ReadLine();
  16. string outputCurrency = Console.ReadLine();
  17.  
  18. if (inputCurrency == "USD" || inputCurrency =="usd") sum *= 1.79549;
  19. else if (inputCurrency == "EUR" || inputCurrency == "eur") sum *= 1.95583;
  20. else if (inputCurrency == "GBP" || inputCurrency == "gbp") sum *= 2.53405;
  21.  
  22. if (outputCurrency == "USD" || outputCurrency == "usd") sum /= 1.79549;
  23. else if (outputCurrency == "EUR" || outputCurrency == "eur") sum /= 1.95583;
  24. else if (outputCurrency == "GBP" || outputCurrency == "gbp") sum /= 2.53405;
  25.  
  26. Console.WriteLine("{0:F2} {1}",sum,outputCurrency);
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement