Advertisement
Guest User

Untitled

a guest
Feb 11th, 2018
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 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 _12.Currency_Converter
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var amountToConvert = double.Parse(Console.ReadLine());
  14. var inputCurrency = Console.ReadLine();
  15. var OutputCurrency = Console.ReadLine();
  16. var USDtoBGN = amountToConvert * 1.79549;
  17. var BGNtoEUR = amountToConvert / 1.95583;
  18. var EURtoGBP = amountToConvert * 0.771659919;
  19. var USDtoEUR = amountToConvert * 0.917991;
  20. var GBPtoUSD = amountToConvert * 1.411;
  21. if (inputCurrency == "USD")
  22. if (OutputCurrency == "BGN")
  23. {
  24. Console.WriteLine(Math.Round(USDtoBGN, 2) + " BGN");
  25. }
  26. if (inputCurrency == "BGN")
  27. {
  28. Console.WriteLine(Math.Round(BGNtoEUR, 2) + " EUR");
  29. }
  30. if (inputCurrency == "EUR")
  31. {
  32. Console.WriteLine(Math.Round(EURtoGBP, 2) + " GBP");
  33. }
  34. if (inputCurrency == "USD")
  35. if (OutputCurrency == "EUR")
  36. {
  37. Console.WriteLine(Math.Round(USDtoEUR, 2) + " EUR");
  38. }
  39. if (inputCurrency == "GBP")
  40. if (OutputCurrency == "USD")
  41. {
  42. Console.WriteLine(Math.Round(GBPtoUSD, 2) + " USD");
  43. }
  44. }
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement