Limited access

Upgrade to access all content for this subject

A typical high school teacher has multiple class sections to teach during a day and each section will have up to 35 students. Each student can have multiple email addresses.

Of the following examples, which would be the BEST way to structure this information in java classes?

A
public class Teacher {
    private String teacherName;
    private int[ ] sections;
    private String[ ] students;
    private String[ ] emailAddresses;
    // methods not shown
}
B
public class Teacher {
    private String teacherName;
    private Section[ ] sections;
    // methods not shown
}

public class Section {
    private int section; 
    private String[ ] studentNames;
    private String[ ] emailAddresses;
    // methods not shown
}
C
public class Teacher {
    private String teacherName;
    private Student[ ] students;
    // methods not shown
}

public class Section {
    private int section; 
    private String courseName; 
    // methods not shown
}

public class Student {
    private String studentName;
    private String[ ] emailAddresses;
    // methods not shown
}
D
public class Teacher {
    private String teacherName;
    private Section[ ] sections;
    // methods not shown
}

public class Section {
    private int section;
    private String courseName;
    private Student[ ] students;
    private String[ ] emailAddresses;
    // methods not shown
}

public class Student {
    private String studentName;
    // methods not shown
}
E
public class Teacher {
    private String teacherName;
    private Section[ ] sections;
    // methods not shown
}

public class Section {
    private int section;
    private String courseName;
    private Student[ ] students;
    // methods not shown
}

public class Student {
    private String studentName;
    private String[ ] emailAddresses;
    // methods not shown
}
Select an assignment template