diff --git a/assignment4/Question1/StartGrading.java b/assignment4/Question1/StartGrading.java new file mode 100644 index 0000000..c05a912 --- /dev/null +++ b/assignment4/Question1/StartGrading.java @@ -0,0 +1,12 @@ +public class StartGrading { + public static void testCourse() + { + // Since we cannot create any Course object, + //the testCourse method of the Course class must be empty. + } + + public static void main(String[] args) + { + testCourse(); + } +} diff --git a/assignment4/Question2/StartGrading.java b/assignment4/Question2/StartGrading.java new file mode 100644 index 0000000..086a1a3 --- /dev/null +++ b/assignment4/Question2/StartGrading.java @@ -0,0 +1,17 @@ +public class StartGrading { + public static void testCourse() + { + // Since we cannot create any Course object, + //the testCourse method of the Course class must be empty. + } + public static void testMajorRequired() + { + //Since we cannot create any MajorRequired object, + //the testMajorRequired method of the Course class must be empty. + } + public static void main(String[] args) + { + testCourse(); + testMajorRequired(); + } +} diff --git a/assignment4/Question3/StartGrading.java b/assignment4/Question3/StartGrading.java new file mode 100644 index 0000000..3f767e2 --- /dev/null +++ b/assignment4/Question3/StartGrading.java @@ -0,0 +1,26 @@ +public class StartGrading { + public static void testCourse() + { + // Since we cannot create any Course object, + //the testCourse method of the Course class must be empty. + } + + public static void testMajorRequired() + { + //Since we cannot create any MajorRequired object, + //the testMajorRequired method of the Course class must be empty. + } + + public static void testMajorElective() + { + //Since we cannot create any MajorElective object, + //the testMajorElective method of the Course class must be empty. + } + + public static void main(String[] args) + { + testCourse(); + testMajorElective(); + testMajorRequired(); + } +} diff --git a/assignment4/Question4/StartGrading.java b/assignment4/Question4/StartGrading.java new file mode 100644 index 0000000..776a47a --- /dev/null +++ b/assignment4/Question4/StartGrading.java @@ -0,0 +1,38 @@ +public class StartGrading { + public static void testCourse() + { + // Since we cannot create any Course object, + //the testCourse method of the Course class must be empty. + } + + public static void testMajorRequired() + { + //Since we cannot create any MajorRequired object, + //the testMajorRequired method of the Course class must be empty. + } + + public static void testMajorElective() + { + //Since we cannot create any MajorElective object, + //the testMajorElective method of the Course class must be empty. + } + + public static void testBase() + { + Base b = new Base("DS1001", "EntryCourse"); + System.out.println(b.getCode() == "DS1001"); + System.out.println(b.getTitle() == "EntryCourse"); + System.out.println(b.getPreRequisite() == b); + } + + public static void main(String[] args) + { + testCourse(); + testMajorElective(); + testMajorRequired(); + testBase(); + } + + + +} diff --git a/assignment4/Question5/StartGrading.java b/assignment4/Question5/StartGrading.java new file mode 100644 index 0000000..1f95661 --- /dev/null +++ b/assignment4/Question5/StartGrading.java @@ -0,0 +1,64 @@ +public class StartGrading { + public static void testCourse() + { //Since we cannot create any Course object, + //the testAnimal method of the Course class must be empty. + } + + public static void testMajorRequired() + { + //create a Base object + Base b = new Base("DS1001","EntryCourse"); + //create a first MajorRequired object with the base course as pre-requisite + MajorRequired mr1 = new MajorRequired("DS200X","OOP",b); + //create a second MajorRequired object with the first major required course as pre-requisite + MajorRequired mr2 = new MajorRequired("DS300X","Data Mining",mr1); + + //test mr1 + System.out.println(mr1.getCode()=="DS200X"); + System.out.println(mr1.getTitle()=="OOP"); + System.out.println(mr1.getPreRequisite() == b); + + //test mr2 + System.out.println(mr2.getCode()=="DS300X"); + System.out.println(mr2.getTitle()=="Data Mining"); + System.out.println(mr2.getPreRequisite() == mr1); + } + + public static void testMajorElective() + { + //create a Base object + Base b = new Base("DS1001","EntryCourse"); + //create a first MajorRequired object with the base course as pre-requisite + MajorRequired mr1 = new MajorRequired("DS200X","OOP",b); + //create a MajorElective object with the major required course as pre-requisite + MajorElective me1 = new MajorElective("DS300X","Data Mining",mr1); + + //test mr1 + System.out.println(mr1.getCode()=="DS200X"); + System.out.println(mr1.getTitle()=="OOP"); + System.out.println(mr1.getPreRequisite() == b); + + //test mr2 + System.out.println(me1.getCode()=="DS300X"); + System.out.println(me1.getTitle()=="Data Mining"); + System.out.println(me1.getPreRequisite() == mr1); + } + + public static void testBase() + { + Base b = new Base("DS1001", "EntryCourse"); + System.out.println(b.getCode() == "DS1001"); + System.out.println(b.getTitle() == "EntryCourse"); + //System.out.println(b.isRequired() == true); + System.out.println(b.getPreRequisite() == b); + } + + + public static void main(String[] args) + { + testCourse(); + testBase(); + testMajorRequired(); + testMajorElective(); + } +} diff --git a/assignment4/Question6/StartGrading.java b/assignment4/Question6/StartGrading.java new file mode 100644 index 0000000..a69ce9d --- /dev/null +++ b/assignment4/Question6/StartGrading.java @@ -0,0 +1,76 @@ +public class StartGrading { + public static void testCourse() + { //Since we cannot create any Course object, + //the testAnimal method of the Course class must be empty. + } + + public static void testMajorRequired() + { + //create a Base object + Base b = new Base("DS1001","EntryCourse"); + //create a first MajorRequired object with the base course as pre-requisite + MajorRequired mr1 = new MajorRequired("DS200X","OOP",b); + //create a second MajorRequired object with the first major required course as pre-requisite + MajorRequired mr2 = new MajorRequired("DS300X","Data Mining",mr1); + + //test mr1 + System.out.println(mr1.getCode()=="DS200X"); + System.out.println(mr1.getTitle()=="OOP"); + System.out.println(mr1.getPreRequisite() == b); + + //test mr2 + System.out.println(mr2.getCode()=="DS300X"); + System.out.println(mr2.getTitle()=="Data Mining"); + System.out.println(mr2.getPreRequisite() == mr1); + } + + public static void testMajorElective() + { + //create a Base object + Base b = new Base("DS1001","EntryCourse"); + //create a first MajorRequired object with the base course as pre-requisite + MajorRequired mr1 = new MajorRequired("DS200X","OOP",b); + //create a MajorElective object with the major required course as pre-requisite + MajorElective me1 = new MajorElective("DS300X","Data Mining",mr1); + + //test mr1 + System.out.println(mr1.getCode()=="DS200X"); + System.out.println(mr1.getTitle()=="OOP"); + System.out.println(mr1.getPreRequisite() == b); + + //test mr2 + System.out.println(me1.getCode()=="DS300X"); + System.out.println(me1.getTitle()=="Data Mining"); + System.out.println(me1.getPreRequisite() == mr1); + } + + public static void testBase() + { + Base b = new Base("DS1001", "EntryCourse"); + System.out.println(b.getCode() == "DS1001"); + System.out.println(b.getTitle() == "EntryCourse"); + //System.out.println(b.isRequired() == true); + System.out.println(b.getPreRequisite() == b); + } + + public static void testManyCourses() + { + Base b = new Base("DS1001","EntryCourse"); + MajorRequired mr1 = new MajorRequired("DS200X","OOP",b); + MajorElective me1 = new MajorElective("DS300X","Data Mining",mr1); + ManyCourses mc = new ManyCourses(); + mc.addCourse(b); + mc.addCourse(mr1); + mc.addCourse(me1); + mc.listCourses(); + } + + public static void main(String[] args) + { + testCourse(); + testBase(); + testMajorRequired(); + testMajorElective(); + testManyCourses(); + } +}