class Student
{
public int StudentId { get; set; }
public string Name { get; set; }
public Course Course { get; set; }
public Student(int studentId, string name, Course course)
{
StudentId = studentId;
Name = name;
Course = course;
}
public void PrintInfo()
{
Console.WriteLine("Student ID: " + StudentId);
Console.WriteLine("Name: " + Name);
Console.WriteLine("Current Course: " + Course.Name);
Console.WriteLine("Course Instructor: " + Course.Instructor);
}
}
class Course
{
public int CourseId { get; set; }
public string Name { get; set; }
public string Instructor { get; set; }
public Course(int courseId, string name, string instructor)
{
CourseId = courseId;
Name = name;
Instructor = instructor;
}
}
List<Student> studentList = new List<Student>()
{
new Student(10001, "Alice", new Course(1, "Mathematics", "John Smith")),
new Student(10002, "Bob", new Course(2, "Computer Science", "Jane Doe")),
new Student(10003, "Charlie", new Course(3, "History", "Susan Johnson")),
new Student(10004, "David", new Course(1, "Mathematics", "John Smith")),
new Student(10005, "Eva", new Course(4, "Physics", "Robert Brown")),
new Student(10006, "Frank", new Course(5, "Biology", "Emma Wilson")),
new Student(10007, "Grace", new Course(3, "History", "Susan Johnson")),
new Student(10008, "Henry", new Course(6, "Chemistry", "William Garcia")),
new Student(10009, "Ivy", new Course(7, "Music", "Olivia Davis")),
new Student(10010, "Jack", new Course(8, "Art", "Michael Taylor"))
};