//10 objects will be defined here
Students s1 = new Students{};
s1.id = 101;
s1.name= "Andy";
s1.subject = "BIS101";
s1.score = 89;
Students s2 = new Students{};
s2.id = 101;
s2.name= "Andy";
s2.subject = "BIS102";
s2.score = 95;
Students s3 = new Students{};
s3.id = 102;
s3.name= "Katty";
s3.subject = "BIS103";
s3.score = 70;
Students s4 = new Students{};
s4.id = 103;
s4.name= "Aimy";
s4.subject = "BIS101";
s4.score = 70;
Students s5 = new Students{};
s5.id = 104;
s5.name= "Kody";
s5.subject = "BIS102";
s5.score = 60;
Students s6 = new Students{};
s6.id = 104;
s6.name= "Kody";
s6.subject = "BIS103";
s6.score = 70;
Students s7 = new Students{};
s7.id = 103;
s7.name= "Aimy";
s7.subject = "BIS103";
s7.score = 50;
Students s8 = new Students{};
s8.id = 102;
s8.name= "Kathy";
s8.subject = "BIS102";
s8.score = 40;
Students s9 = new Students{};
s9.id = 105;
s9.name= "Pretty";
s9.subject = "BIS103";
s9.score = 50;
Students s10 = new Students{};
s10.id = 105;
s10.name= "Pretty";
s10.subject = "BIS101";
s10.score = 60;
//create a new basket
List<Students> list1 = new List<Students>();
//add those objects into basket
list1.Add(s1);list1.Add(s2);list1.Add(s3);list1.Add(s4);
list1.Add(s5);list1.Add(s6);list1.Add(s7);list1.Add(s8);
list1.Add(s9);list1.Add(s10);
このコードから、2 つのコースに登録している学生を見つけるにはどうすればよいですか?? 私はこれを整理しようとしてきましたが、私は初心者なので、それ以上進むことができませんでした。
どんな助けでも大歓迎です!
前もって感謝します!