Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 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 CurrencyConverter
  8. {
  9. class CurrencyConverter
  10. {
  11. static void Main(string[] args)
  12. {
  13. var size = double.Parse(Console.ReadLine());
  14. var inCurrency = Console.ReadLine().ToUpper();
  15. var outCurrency = Console.ReadLine().ToUpper();
  16.  
  17. if (inCurrency == "USD")
  18. {
  19. size = size * 1.79549;
  20. }
  21. else if (inCurrency == "EUR")
  22. {
  23. size = size * 1.95583;
  24. }
  25. else if (inCurrency == "GBP")
  26. {
  27. size = size * 2.53405;
  28. }
  29. else if (inCurrency == "BGN")
  30. {
  31. size = size;
  32. }
  33.  
  34. if (outCurrency == "USD")
  35. {
  36. size = size / 1.79549;
  37. }
  38. else if (outCurrency == "EUR")
  39. {
  40. size = size / 1.95583;
  41. }
  42. else if (outCurrency == "GBP")
  43. {
  44. size = size / 2.53405;
  45. }
  46. else if (outCurrency == "BGN")
  47. {
  48. size = size;
  49.  
  50. }
  51. Console.WriteLine("{0:F2} {1}", size, outCurrency);
  52.  
  53.  
  54.  
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement