Advertisement
Guest User

Untitled

a guest
Jun 19th, 2016
1,327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5. static void Main()
  6. {
  7. Console.Write("Enter amount:");
  8. var amount = double.Parse(Console.ReadLine());
  9. Console.Write("Enter currency(BGN,USD,EUR,GBP):");
  10. var currency = Console.ReadLine();
  11. Console.Write("Enter output currency(BGN,USD,EUR,GBP):");
  12. var outputCurrency = Console.ReadLine();
  13. if (currency == "USD" && outputCurrency == "BGN")
  14. {
  15. var n = amount * 1.79549;
  16. Console.WriteLine("BGN:{0}", Math.Round(n, 2));
  17. }
  18. else if (currency == "BGN" && outputCurrency == "EUR")
  19. {
  20. var n1 = amount / 1.95583;
  21. Console.WriteLine("EUR:{0}", Math.Round(n1,2));
  22. }
  23. else if (currency=="EUR" && outputCurrency=="GBP")
  24. {
  25. var n2 = amount * 0.7716599190283401;
  26. Console.WriteLine("GBP:{0}",Math.Round(n2,2));
  27. }
  28. else if (currency=="USD" && outputCurrency=="EUR")
  29. {
  30. var n3 = amount * 0.9179913535084802;
  31. Console.WriteLine("EUR:{0}",Math.Round(n3,2));
  32. }
  33. else if (currency == "GBP" && outputCurrency == "USD")
  34. {
  35. var n4 = amount * 1.411336032388664;
  36. Console.WriteLine("USD:{0}", Math.Round(n4, 2));
  37. }
  38. else
  39. Console.WriteLine("Invalid currency");
  40.  
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement