OOD: My School

School Application from Ben Grass original presentation on 2/18/16

appschool

Classwork:
Period 4

a. The Student ADT:
i. init “classes” array to constant numCourses = 8
ii. create a new instance field, courseCount
Implement the following methods:
i. public void addCourse(Course aCourse):
ii. public String getAllInfo(), it should return name, age, gap, grade and a list of all classes.
iii. public String getCourses(), it returns all courses names.

c. The Course ADT:
i. Overload constructor so subject, teacher and period are the input arguments.

d. The School ADT:
i. Implement the method public String getAllStudentNames(). It should return all the students names.
ii. Implement the method public String getAllStuInfo(). It should return name, age, gap, grade and classes for all students.

  • main:
    a. Create a new class, (the driver) MySchool
    b. Copy the main method from School and remove it.
    c. Create 3 or 4 more Course objects with your own information.
    d. Create 2 or 3 more Teacher objects with your own information.
    e. Create 5 or 6 more Student objects with your own information.
    f. Add all students to PHS.
    g. Add all teachers to PHS.
    h. Add 2 courses to 4 students.
    i. Add the 4 students to a teacher.
    j. Print all students names from the teacher above.
    k. Print all PHS students names.

Period 5

Classwork:

a. The Student ADT:
i. Overload public Student(String name, int year, double GPA)
ii. Implement the method public void addCourse(Course aCourse)
iii. Implement the method public String getAllInfo() in the Student ADT. It should print name, age, gap, grade and classes for all students.

b. The Course ADT:
i. Overload the constructor so subject, teacher and period are the input arguments.

d. The Teacher ADT:
i. Add String degree instance field
ii. Overload public Teacher(String degree, String name, int experience).

c. The School ADT:
i. Implement the method public String getAllStudentNames(). It should return all the students names.

NOTE: some extra instance field are needed.

  • main:
    a. Create a new class, (the driver) MySchool
    b. Copy the main method from School and remove it.
    c. Create 3 or 4 more Course objects with your own information.
    d. Create 2 or 3 more Teacher objects with your own information.
    e. Create 5 or 6 more Student objects with your own information.
    f. Add all students to PHS.
    g. Add all teachers to PHS.
    h. Add 2 courses to 4 students.
    i. Add the 4 students to a teacher.
    j. Print all students names from the teacher above.
    k. Print all PHS students names.


Homework:

* Documentation for each method in each ADT. Include at least one comment line describing the purpose of the method.
* Make all the instance fields private.
* Implement the following methods:
getAllTeachersName()
getAllTeacherStudentNames()