Advertisement
Guest User

Untitled

a guest
Jun 14th, 2018
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 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. namespace ConsoleApp2
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. double bgnValue = 1;
  13. double usdValue = 1.79549;
  14. double eurValue = 1.95583;
  15. double gbpValue = 2.53405;
  16. double price = double.Parse(Console.ReadLine());
  17. var input = Console.ReadLine().ToLower();
  18. var output = Console.ReadLine().ToLower();
  19. double valueInput;
  20. double valueOutput;
  21. if (input == "bgn")
  22. {
  23. valueInput = (price * bgnValue);
  24. }
  25. else if (input == "usd")
  26. {
  27. valueInput = (price * usdValue);
  28. }
  29. else if (input == "eur")
  30. {
  31. valueInput = (price * eurValue);
  32. }
  33. else
  34. {
  35. valueInput = (price * gbpValue);
  36. }
  37. if (output == "bgn")
  38. {
  39. valueOutput = (valueInput / bgnValue);
  40. }
  41. else if (output == "usd")
  42. {
  43. valueOutput = (valueInput / usdValue);
  44. }
  45. else if (output == "eur")
  46. {
  47. valueOutput = (valueInput / eurValue);
  48. }
  49. else
  50. {
  51. valueOutput = (valueInput / gbpValue);
  52. }
  53. Console.WriteLine(valueOutput);
  54.  
  55. //Курс USD EUR GBP
  56. // 1 BGN 1.79549 1.95583 2.53405
  57.  
  58. //var input = Console.ReadLine();// Enter BGN, USD, EUR or GBP currency
  59. // var output = Console.ReadLine();// Enter BGN, USD, EUR or GBP currency
  60.  
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement