Advertisement
Guest User

Untitled

a guest
Jul 15th, 2015
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.09 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 last
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string ten, loai_san_pham = "";
  14.             int so_luong = 0;
  15.             int HMA = 200000;
  16.             int VIP72 = 600000;
  17.             int sock = 400000;
  18.             int tong_tien = 0;
  19.             int tien_giam = 0;
  20.             Console.WriteLine("Chao mung den voi cua hang MMO");
  21.             Console.WriteLine("Shop chung toi chi ban 3 loai san pham : HMA , VIP72 , sock");
  22.             Console.WriteLine("HMA co gia 200 000/1 tai khoan");
  23.             Console.WriteLine("VIP72 co gia 600 000/1 tai khoan");
  24.             Console.WriteLine("Con sock co gia 400 000/1 tai khoan");
  25.             Console.WriteLine("Ten ban la gi ?");
  26.             ten = (Console.ReadLine());
  27.             Console.WriteLine("Ban muon mua loai tai khoan nao nhi ?(nhap dung dinh dang HMA, VIP72, sock)");
  28.             loai_san_pham = (Console.ReadLine());
  29.             Console.WriteLine("Ban muon mua bao nhieu tai khoan?");
  30.             so_luong = Convert.ToInt32(Console.ReadLine());
  31.             switch (loai_san_pham)
  32.             {
  33.                 case "HMA":
  34.                     tong_tien = HMA * so_luong;
  35.                     break;
  36.                 case "VIP72":
  37.                     tong_tien = VIP72 * so_luong;
  38.                     break;
  39.                 case "sock":
  40.                     tong_tien = sock * so_luong;
  41.                     break;
  42.                 default:
  43.                     Console.WriteLine("Ban nhap sai roi , tat di bat lai nha ^^");
  44.                     break;
  45.             }
  46.  
  47.             if (so_luong >= 1 && so_luong <= 10)
  48.             {
  49.                 tien_giam = tong_tien * 1 / 10;
  50.             }
  51.             else if (so_luong > 10 && so_luong < 20)
  52.             {
  53.                 Console.WriteLine("");
  54.                 tien_giam = tong_tien * 2 / 10;
  55.             }
  56.             else
  57.             {
  58.                 tien_giam = tong_tien * 3 / 10;
  59.             }
  60.             int tien_phai_tra = tong_tien - tien_giam;
  61.             Console.WriteLine("Hoa don");
  62.             Console.WriteLine("Ten khach hang : " + ten);
  63.             Console.WriteLine("so tien khi chua giam gia: " + tong_tien);
  64.             Console.WriteLine("So tien giam gia : " + tien_giam);
  65.             Console.WriteLine("So tien phai tra la: " + tien_phai_tra);
  66.             if (tien_phai_tra >= 100000 && tien_phai_tra <= 200000)
  67.             {
  68.                 Console.WriteLine("Ban duoc tang 5 point vao acc");
  69.                 Console.ReadLine();
  70.             }
  71.             else if (tien_phai_tra > 200000 && tien_phai_tra <= 400000)
  72.             {
  73.                 Console.WriteLine("Ban duoc tang 10 point vao acc");
  74.                 Console.ReadLine();
  75.             }
  76.             else if (tien_phai_tra > 400000) ;
  77.             {
  78.                 Console.WriteLine("Ban duoc tang 15 point vao acc");
  79.                 Console.ReadLine();
  80.             }
  81.             Console.ReadLine();
  82.         }
  83.     }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement