implement triangle method
This commit is contained in:
@@ -1,15 +1,40 @@
|
|||||||
package CourseRegistrationStarter;
|
package CourseRegistrationStarter;
|
||||||
|
|
||||||
public class Main {
|
public class Main
|
||||||
|
{
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
{
|
{
|
||||||
// TODO:
|
|
||||||
// 1. Create at least 3 courses
|
// 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
|
// 2. Create 1 student
|
||||||
|
Student s1 = new Student("Romina", "40123456");
|
||||||
|
|
||||||
// 3. Create a registration system
|
// 3. Create a registration system
|
||||||
|
RegistrationSystem regSys = new RegistrationSystem();
|
||||||
|
|
||||||
// 4. Add courses to the system
|
// 4. Add courses to the system
|
||||||
|
regSys.addCourseToSystem(c1);
|
||||||
|
regSys.addCourseToSystem(c2);
|
||||||
|
regSys.addCourseToSystem(c3);
|
||||||
|
|
||||||
|
regSys.showAllCourses();
|
||||||
|
|
||||||
// 5. Register the student in some courses
|
// 5. Register the student in some courses
|
||||||
|
s1.addCourse(c1);
|
||||||
|
s1.addCourse(c2);
|
||||||
|
s1.addCourse(c3);
|
||||||
|
|
||||||
|
s1.showRegisteredCourses();
|
||||||
|
|
||||||
// 6. Drop one course
|
// 6. Drop one course
|
||||||
|
s1.dropCourse(c2);
|
||||||
|
|
||||||
// 7. Print the final registered course list
|
// 7. Print the final registered course list
|
||||||
|
s1.showRegisteredCourses();
|
||||||
|
|
||||||
|
regSys.showAllCourses();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user