using System.Collections.Generic;
public static void Main()
List<Exciter> exLst = new List<Exciter>();
List<Sirius> silst = new List<Sirius>();
option = Console.ReadLine();
Exciter _Exciter = new Exciter();
Sirius _Sirius = new Sirius();
foreach(Exciter ex in exLst)
foreach (Sirius si in silst)
Console.WriteLine("Nhập Code");
code = Console.ReadLine();
foreach(Exciter ex in exLst)
Console.WriteLine("Nhập Code");
code = Console.ReadLine();
foreach (Sirius si in silst)
Console.WriteLine("Nhập sai chức năng");
} while (!option.Equals("ea"));
Console.WriteLine("\nCHƯƠNG TRÌNH QUẢN LÝ XE GẮN MÁY YAMAHA");
Console.WriteLine("*********************************MENU************************************");
Console.WriteLine("** 1. Nhập thông tin xe Exciter (nhập: iei) **");
Console.WriteLine("** 2. Nhập thông tin xe Sirius (nhập: isi) **");
Console.WriteLine("** 3. Hiển thị thông tin xe Exciter (nhập: sei) **");
Console.WriteLine("** 4. Hiển thị thông tin xe Sirius (nhập: ssi) **");
Console.WriteLine("** 5. Tìm kiếm xe Exciter (nhập: se) **");
Console.WriteLine("** 6. Tìm kiếm xe Sirius (nhập: ss) **");
Console.WriteLine("** 7. Thoát chương trình (nhập: ea) **");
Console.WriteLine("** Lựa chọn của bạn: **");
Console.WriteLine("*************************************************************************");
public string Code { get; set; }
public string Name { get; set; }
public int Capacity { get; set; }
public string Type { get; set; }
public MyMotor(string code, string name, int capacity, string type)
this.Capacity = capacity;
Console.WriteLine("Nhập code tối thiểu 4 ký tự");
this.Code = Console.ReadLine();
} while (this.Code.Trim().Length < 4);
Console.WriteLine("Nhập Name tối thiểu 6 ký tự");
this.Name = Console.ReadLine();
} while (this.Name.Trim().Length < 6);
Console.WriteLine("Nhập Capacity>=50 ");
this.Capacity = Convert.ToInt32(Console.ReadLine());
} while (this.Capacity < 50);
Console.WriteLine("Nhập loại xe( tay ga hoặc xe so)");
this.Type = Console.ReadLine();
} while (!this.Type.Equals("tay ga") && !this.Type.Equals("xe so"));
Console.WriteLine("-------------------------");
Console.WriteLine("Code :{0}", Code);
Console.WriteLine("Name :{0}", Name);
Console.WriteLine("Capacity :{0}", Capacity);
Console.WriteLine("Type :{0}", Type);
public int Warranty { get; set; }
public Exciter(int warranty, string code, string name, int capacity, string type) :base(code, name, capacity, type)
this.Warranty = warranty;
Console.WriteLine("Nhập năm bảo hành tối thiểu 1 năm");
this.Warranty = int.Parse( Console.ReadLine());
} while (this.Code.Trim().Length < 1);
Console.WriteLine("Warranty :{0}", Warranty);
Console.WriteLine("-------------------------");
public string Color { get; set; }
public Sirius(string color, string name, string code, int capacity, string type):base(code, name, capacity, type)
Console.WriteLine("Nhập màu xe (xanh, vang, trang)");
this.Color = Console.ReadLine();
} while (!this.Color.Trim().Equals("xanh")&&!this.Color.Equals("vang")&&!this.Color.Equals("trang"));
Console.WriteLine("color :{0}", Color);
Console.WriteLine("-------------------------");