Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2
You can have a class for Classroom with 2 member variables name and an extendable array of students. So you can give you classroom a name and you can add student objects to the array. The student class can have a name, an array of classrooms and an array of assignments. So that the student can keep track of their name(ofcourse), all the classrooms they are in and the assignments assigned to them. It can have a member function "assign" that takes in an object of assignment class and adds it to the array of assignments. I didn't get any idea for the assignment class, maybe you can do something that allows you to do like, "students[0].assign(new Assignment("Mathematics"))". Like just a simple container class. This is not C# but i guess you can understand. And you can add some more features to it, like giving the student the ability to unenroll from a classroom. If you have used the Google classrooms application, you'll get more ideas
17th Feb 2022, 2:40 AM
Rishi
Rishi - avatar
+ 2
i Jaron why do you get string and Student as two different arguments? The student's name is inside the object itself. So you can just get the Student object and find the name inside the function
18th Feb 2022, 2:39 AM
Rishi
Rishi - avatar
+ 1
i Jaron do you know C++ or Java? I don't know C#. Or I can show you some pseudo code. See if you get the below snippet class Student{ string name; array classrooms; } class Classroom{ string class_name; //example "mathematics" or "physics" array students; void addStudent(Student s){ students.add(s); } }
18th Feb 2022, 5:18 AM
Rishi
Rishi - avatar