desislava777

Currency Converter

Oct 24th, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 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 BGdolar
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double num = double.Parse(Console.ReadLine());
  14. string Currency1 = Console.ReadLine();
  15. string Currency2 = Console.ReadLine();
  16. double valuta1 = 0.0;
  17. double valuta2 = 0.0;
  18. if (Currency1 == "BGN")
  19. {
  20. valuta1 = 1;
  21. }
  22. else if (Currency1 == "USD")
  23. {
  24. valuta1 = 1.79549;
  25. }
  26. else if (Currency1 == "EUR")
  27. {
  28. valuta1 = 1.95583;
  29. }
  30. else if (Currency1 == "GBP")
  31. {
  32. valuta1 = 2.53405;
  33. }
  34. if (Currency2 == "BGN")
  35. {
  36. valuta2 = 1;
  37. }
  38. else if (Currency2 == "USD")
  39. {
  40. valuta2 = 1.79549;
  41. }
  42. else if (Currency2 == "EUR")
  43. {
  44. valuta2 = 1.95583;
  45. }
  46. else if (Currency2 == "GBP")
  47. {
  48. valuta2 = 2.53405;
  49. }
  50. double result = num * (valuta1 / valuta2);
  51. Console.WriteLine(Math.Round(result, 2));
  52. }
  53.  
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment