Advertisement
hongan

baitap2

Aug 10th, 2015
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.92 KB | None | 0 0
  1. string name, dichvu = "";
  2. int sochon , soluong , thanhtien = 0;
  3. Console.WriteLine("Chao mung cac ban den voi dich vu mmo");
  4. Console.WriteLine("Vui long cho biet ten cua ban:");
  5. name = Console.ReadLine();
  6. Console.WriteLine("Xin chao"+" "+name+" "+"vui long chon loai dich vu ban muon mua");
  7. Console.WriteLine("Account Hma = 100.000$");
  8. Console.WriteLine("Account Vip72 = 200.000$");
  9. Console.WriteLine("Account Sockescort = 300.000$");
  10. Console.WriteLine("1 = Hma , 2 = Vip 72 , 3 = Sockescort");
  11. sochon = Convert.ToInt32(Console.ReadLine());
  12. switch (sochon)
  13. {
  14. case 1:
  15. Console.WriteLine("Hay nhap so luong account Hma ban muon mua");
  16. soluong =Convert.ToInt32(Console.ReadLine());
  17. if (soluong ==0)
  18. {
  19. Console.WriteLine("Hay mua it nhat mot account");
  20. }
  21. else if( soluong >0 && soluong <=10)
  22. {
  23. thanhtien = (soluong * 100000) - (soluong * 100000 * 10/100);
  24. Console.WriteLine("Tong so tien la:" + " " + thanhtien + "$");
  25. }
  26. else if(soluong >=11 && soluong <=20)
  27. {
  28. thanhtien = (soluong * 100000) - (soluong * 100000 * 20 / 100);
  29. Console.WriteLine("Tong so tien la:" + " " + thanhtien + "$");
  30. }
  31. else
  32. {
  33. thanhtien = (soluong * 100000) - (soluong * 100000 * 30 / 100);
  34. Console.WriteLine("Tong so tien la:" + " " + thanhtien + "$");
  35. }
  36. break;
  37. case 2:
  38. Console.WriteLine("Hay nhap so luong account Vip 72 ban muon mua");
  39. soluong = Convert.ToInt32(Console.ReadLine());
  40. if (soluong ==0)
  41. {
  42. Console.WriteLine("Hay mua it nhat mot account");
  43. }
  44. else if( soluong >0 && soluong <=10)
  45. {
  46. thanhtien = (soluong * 200000) - (soluong * 200000 * 10 / 100);
  47. Console.WriteLine("Tong so tien la:" + " " + thanhtien + "$");
  48. }
  49. else if(soluong >=11 && soluong <=20)
  50. {
  51. thanhtien = (soluong * 200000) - (soluong * 200000 * 20 / 100);
  52. Console.WriteLine("Tong so tien la:" + " " + thanhtien + "$");
  53. }
  54. else
  55. {
  56. thanhtien = (soluong * 200000) - (soluong * 200000 * 30 / 100);
  57. Console.WriteLine("Tong so tien la:" + " " + thanhtien + "$");
  58. }
  59. break;
  60. case 3:
  61. Console.WriteLine("Hay nhap so luong account Sockescort ban muon mua");
  62. soluong = Convert.ToInt32(Console.ReadLine());
  63. if (soluong ==0)
  64. {
  65. Console.WriteLine("Hay mua it nhat mot account");
  66. }
  67. else if( soluong >0 && soluong <=10)
  68. {
  69. thanhtien = (soluong * 300000) - (soluong * 300000 * 10 / 100);
  70. Console.WriteLine("Tong so tien la:"+" "+thanhtien+"$");
  71. }
  72. else if(soluong >=11 && soluong <=20)
  73. {
  74. thanhtien = (soluong * 300000) - (soluong * 300000 * 20 / 100);
  75. Console.WriteLine("Tong so tien la:" + " " + thanhtien + "$");
  76. }
  77. else
  78. {
  79. thanhtien = (soluong * 300000) - (soluong * 300000 * 30 / 100);
  80. Console.WriteLine("Tong so tien la:" + " " + thanhtien + "$");
  81. }
  82. break;
  83. }
  84. if (thanhtien >= 100000 && thanhtien <=200000)
  85. {
  86. Console.WriteLine(name+" "+"se duoc cong them 5 point vao tai khoan");
  87. }
  88. else if (thanhtien >200000 && thanhtien <=400000)
  89. {
  90. Console.WriteLine(name+" "+"se duoc cong them 10 point vao tai khoan");
  91. }
  92. else if (thanhtien > 200000 && thanhtien <= 400000)
  93. {
  94. Console.WriteLine(name+" "+"se duoc cong them 15 point vao tai khoan");
  95. }
  96. else
  97. {
  98. Console.WriteLine(name+" "+"se duoc cong them 20 point vao tai khoan");
  99. }
  100. Console.ReadLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement