Nộp bài
Nộp bài và hóng bài mới.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string ten, taikhoan;
Console.WriteLine("Chao mung den voi trang mua ban tai khoan MMO, Ban ten gi?");
ten = Console.ReadLine();
int hma = 300, vip72 = 700, escort = 1000, soluong = 0;
Console.WriteLine("Chung toi co bang gia nhu sau -- hma gia: "+hma+"000VND"+"||"+"vip72 gia: "+vip72+"000VND"+"||"+"escort gia: "+escort+"000VND");
Console.WriteLine("Ban can mua loai tai khoan nao ?");
taikhoan = Console.ReadLine();
Console.WriteLine("So luong ban muon mua ?");
soluong = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Loai tai khoan ban mua la: " + taikhoan+"|"+"So luong: "+soluong+" account");
//string s = Convert.ToString(taikhoan);
switch (taikhoan)
{
case "hma":
if (soluong >= 1 && soluong <= 10)
{
Console.WriteLine("Ban mua: " + soluong + "account " + "Ban duoc giam gia 10%");
Console.WriteLine("Khach hang: " + ten + " Tong so tien ban thanh toan la: "+(hma*soluong*0.9)+"000VND");
}
else if (soluong >= 11 && soluong <= 20)
{
Console.WriteLine("Ban mua: " + soluong + "account " + "Ban duoc giam gia 20%");
Console.WriteLine("Khach hang: " + ten + " Tong so tien ban thanh toan la: " + ((hma * soluong) * 0.8) + "000VND");
}
else
{
Console.WriteLine("Ban mua: " + soluong + "account " + "Ban duoc giam gia 30%");
Console.WriteLine("Khach hang: " + ten + " Tong so tien ban thanh toan la: " + ((hma * soluong) * 0.7) + "000VND");
}
int ketqua1, ketqua2, ketqua3;
ketqua1 = hma * soluong * 9/10;
ketqua2 = hma * soluong * 8 / 10;
ketqua3 = hma * soluong * 7 / 10;
if(ketqua1>100000 && ketqua1<=1000000)
{
Console.WriteLine("khach se duoc cong 5 point vao tai khoan thuong");
}
else if (ketqua2 > 1000000 && ketqua2 <= 5000000)
{
Console.WriteLine("khach se duoc cong 10 point vao tai khoan thuong");
}
else
{
Console.WriteLine("khach se duoc cong 15 point vao tai khoan thuong");
}
break;
case "vip72":
if (soluong >= 1 && soluong <= 10)
{
Console.WriteLine("Ban mua: " + soluong + "account " + "Ban duoc giam gia 10%");
Console.WriteLine("Khach hang: " + ten + " Tong so tien ban thanh toan la: " + ((vip72 * soluong) * 0.9) + "000VND");
}
else if (soluong >= 11 && soluong <= 20)
{
Console.WriteLine("Ban mua: " + soluong + "account " + "Ban duoc giam gia 20%");
Console.WriteLine("Khach hang: " + ten + " Tong so tien ban thanh toan la: " + ((vip72 * soluong) * 0.8) + "000VND");
}
else
{
Console.WriteLine("Ban mua: " + soluong + "account " + "Ban duoc giam gia 30%");
Console.WriteLine("Khach hang: " + ten + " Tong so tien ban thanh toan la: " + ((vip72 * soluong) * 0.7) + "000VND");
}
ketqua1 = vip72 * soluong * 9/10;
ketqua2 = vip72 * soluong * 8 / 10;
ketqua3 = vip72 * soluong * 7 / 10;
if(ketqua1>100000 && ketqua1<=1000000)
{
Console.WriteLine("khach se duoc cong 5 point vao tai khoan thuong");
}
else if (ketqua2 > 1000000 && ketqua2 <= 5000000)
{
Console.WriteLine("khach se duoc cong 10 point vao tai khoan thuong");
}
else
{
Console.WriteLine("khach se duoc cong 15 point vao tai khoan thuong");
}
break;
case "escort":
if (soluong >= 1 && soluong <= 10)
{
Console.WriteLine("Ban mua: " + soluong + "account " + "Ban duoc giam gia 10%");
Console.WriteLine("Khach hang: " + ten + " Tong so tien ban thanh toan la: " + ((escort * soluong) * 0.9) + "000VND");
}
else if (soluong >= 11 && soluong <= 20)
{
Console.WriteLine("Ban mua: " + soluong + "account " + "Ban duoc giam gia 20%");
Console.WriteLine("Khach hang: " + ten + " Tong so tien ban thanh toan la: " + ((escort * soluong) * 0.8) + "000VND");
}
else
{
Console.WriteLine("Ban mua: " + soluong + "account " + "Ban duoc giam gia 30%");
Console.WriteLine("Khach hang: " + ten + " Tong so tien ban thanh toan la: " + ((escort * soluong) * 0.7) + "000VND");
}
ketqua1 = vip72 * soluong * 9/10;
ketqua2 = vip72 * soluong * 8 / 10;
ketqua3 = vip72 * soluong * 7 / 10;
if (ketqua1 > 100000 && ketqua1 <= 1000000)
{
Console.WriteLine("khach se duoc cong 5 point vao tai khoan thuong");
}
else if (ketqua2 > 1000000 && ketqua2 <= 5000000)
{
Console.WriteLine("khach se duoc cong 10 point vao tai khoan thuong");
}
else
{
Console.WriteLine("khach se duoc cong 15 point vao tai khoan thuong");
}
break;
default:
Console.WriteLine("Ban da nhap sai tai khoan, vui long nhap lai");
break;
}
Console.ReadLine();
}
}
}