Student Registration #6

Closed
Romina wants to merge 3 commits from Romina/WS-02-intro-to-oop:develop into main
Showing only changes of commit 012c246399 - Show all commits
+28 -3
View File
@@ -1,15 +1,40 @@
package CourseRegistrationStarter;
public class Main {
public class Main
{
public static void main(String[] args)
{
// TODO:
// 1. Create at least 3 courses
Course c1 = new Course("Advanced Programming", "CS101", 2);
Course c2 = new Course("Mathematics", "MATH201", 1);
Course c3 = new Course("Foundations of Mathematical Sciences","MATH301", 3);
// 2. Create 1 student
Student s1 = new Student("Romina", "40123456");
// 3. Create a registration system
RegistrationSystem regSys = new RegistrationSystem();
// 4. Add courses to the system
regSys.addCourseToSystem(c1);
regSys.addCourseToSystem(c2);
regSys.addCourseToSystem(c3);
regSys.showAllCourses();
// 5. Register the student in some courses
s1.addCourse(c1);
s1.addCourse(c2);
s1.addCourse(c3);
s1.showRegisteredCourses();
// 6. Drop one course
s1.dropCourse(c2);
// 7. Print the final registered course list
s1.showRegisteredCourses();
regSys.showAllCourses();
}
}
}