I don't know how your specific project is set up, but it could create a button that says something like Create Student.
When clicked, it calls a Create Student function.
Inside that function instantiate a new Student object.
Prompt the user for the student id.
Prompt the user for the courses.
Store these values into the sid and courses.of that student object.
Push Student Object into Student Array.
Once the function completes the object should go out of scope, meaning that each time they push the create button, a fresh student object is created. Because of this you should create your array outside of this function so that it maintains the data inside the array, rather than being freshly created each time you click the button. If that makes sense.
Should be pretty simple code.
Something like this tied to a button click event, just quick and dirty but gives the idea:
If you have everything set up right, you can then run your code, open the console type in the name of the students array and it should look something like this: