Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Cau_truc_dieu_khien
- {
- class Program
- {
- static void Main(string[] args)
- {
- int hma = 10;
- int vip72 = 15;
- int sock5 = 10;
- string loai_acc = "";
- string tenkhachhang = "";
- int soluong = 0;
- int tongtien = 0;
- int tiengiam = 0;
- int tien = 0;
- int diemthuong = 0;
- Console.WriteLine("Ban mua mua Acc gi ? (Nhap vao hma, vip72, socks5)");
- loai_acc = Console.ReadLine();
- Console.WriteLine("Nhap ten cua ban: ");
- tenkhachhang = Console.ReadLine();
- Console.WriteLine("Nhap so luong acc ban muon mua: ");
- soluong = Convert.ToInt32(Console.ReadLine());
- switch (loai_acc)
- {
- case "hma":
- tien = hma * soluong;
- break;
- case "vip72":
- tien = vip72 * soluong;
- break;
- case "sock5":
- tien = sock5 * soluong;
- break;
- default:
- Console.WriteLine("Vui long nhap vao hma, vip72, socks5");
- break;
- }
- if (soluong > 0 && soluong <= 10)
- {
- tiengiam = tien * 1 / 10;
- }
- else if (soluong > 10 && soluong <= 20)
- {
- tiengiam = tien * 2 / 10;
- }
- else
- {
- tiengiam = tien * 3 / 10;
- }
- if (tiengiam >= 0 && tiengiam < 100)
- {
- diemthuong = diemthuong + 5;
- }
- else if (tiengiam >= 100 && tiengiam <= 200)
- {
- diemthuong = diemthuong + 10;
- }
- else if (tiengiam > 200 && tiengiam <= 300)
- {
- diemthuong = diemthuong + 20;
- }
- else
- {
- diemthuong = diemthuong + 30;
- }
- tongtien = Convert.ToInt32(tien - tiengiam);
- Console.WriteLine("==============Hoa Don Khach Hang==============");
- Console.WriteLine("Xin chao " + tenkhachhang);
- Console.WriteLine("Loai Acc: " + loai_acc);
- Console.WriteLine("So luong Acc ban muon mua la " + soluong + " Va ban duoc giam " + tiengiam + "$");
- Console.WriteLine("So tien ban phai tra la: " + tongtien + "$");
- Console.WriteLine("Ban duoc cong " + diemthuong + " diem vao tai khoan");
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement