Advertisement
bullit3189

Currency Converter

Oct 28th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace _12.CurrencyConverter
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. double money = double.Parse(Console.ReadLine());
  11. string input = Console.ReadLine();
  12. string output = Console.ReadLine();
  13. double lev = 1.0;
  14. double dollar = 1.79549;
  15. double evro = 1.95583;
  16. double pound = 2.53405;
  17. switch (input)
  18. {
  19. case "BGN":
  20. break;
  21. case "USD":
  22. money = money * dollar;
  23. break;
  24. case "EUR":
  25. money = money * evro;
  26. break;
  27. case "GBP":
  28. money = money * pound;
  29. break;
  30. default:
  31. break;
  32. }
  33. switch (output)
  34. {
  35. case "BGN":
  36. money = money / lev;
  37. break;
  38. case "USD":
  39. money = money / dollar;
  40. break;
  41. case "EUR":
  42. money = money / evro;
  43. break;
  44. case "GBP":
  45. money = money / pound;
  46. break;
  47. default:
  48. break;
  49. }
  50. Console.WriteLine(Math.Round (money, 2) + " " + output);
  51.  
  52.  
  53.  
  54.  
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement