Advertisement
Dubwyn

Untitled

Dec 17th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 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 Changedesk
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14.  
  15. string value = Console.ReadLine();
  16. double euro = double.Parse(Console.ReadLine());
  17. var money = 0.0;
  18.  
  19. if (euro > 1000)
  20. {
  21. euro = euro + euro * 0.1;
  22. }
  23.  
  24.  
  25. if (value != "XRP" && value != "BTC" && value != "ETH")
  26. {
  27. Console.WriteLine($"EUR to {value} is not supported.");
  28. }
  29. else
  30. {
  31. //XRP
  32. if (value == "XRP" && euro / 0.22 < 80)
  33. {
  34. Console.WriteLine("Insufficient funds");
  35. }
  36. else if (value == "XRP")
  37. {
  38. money = euro / 0.22;
  39. if (money > 1000 && money < 2500)
  40. {
  41. money = money + money * 0.05;
  42. }
  43. else if (money >= 2500)
  44. {
  45. money = money + money * 0.1;
  46. }
  47. Console.WriteLine($"Successfully purchased {money:f3} {value}");
  48. }
  49. //bitcoin
  50. else if (value == "BTC" && euro / 6400 < 0.001)
  51. {
  52. Console.WriteLine("Insufficient funds");
  53. }
  54. else if (value == "BTC")
  55. {
  56. money = euro / 6400;
  57. if (money > 10)
  58. {
  59. money = money + money * 0.02;
  60. }
  61. Console.WriteLine($"Successfully purchased {money:f3} {value}");
  62. }
  63. //ETH
  64. else if (value == "ETH" && euro / 250 < 0.0099)
  65. {
  66. Console.WriteLine("Insufficient funds");
  67. }
  68. else if (value == "ETH")
  69. {
  70. money = euro / 250;
  71. Console.WriteLine($"Successfully purchased {money:f3} {value}");
  72. }
  73. }
  74. }
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement