Advertisement
Guest User

Untitled

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