Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Program
  7. {
  8. class Program
  9. {
  10. static void Main()
  11. {
  12. var value = double.Parse(Console.ReadLine());
  13. var input = Console.ReadLine();// Enter BGN, USD, EUR or GBP currency
  14. var output = Console.ReadLine();// Enter BGN, USD, EUR or GBP currency
  15. var bgn = 1.0;
  16. var usd = 1.81;
  17. var eur = 1.96;
  18. switch (input)
  19. {
  20. case "BGN":
  21. break;
  22. case "USD":
  23. value = value * usd;break;
  24. case "EUR":
  25. value = value * eur;break;
  26. default:break;
  27. }
  28. switch (output)
  29. {
  30. case "BGN":
  31. value = value / bgn;break;
  32. case "USD":
  33. value = value / usd;break;
  34. case "EUR":
  35. value = value / eur;break;
  36. }
  37. Console.WriteLine(Math.Round(value, 2) + " " + output);
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement