For the given sequence diagram, Which of the following correctly implements the design? a)public class Student { private Course c1 = new Course(); public void enroll() { c1.register(); c1.accessCourse(); } } b) public class Course { private Course c1 = new Student(); public void enroll() { c1.register(); c1.accessCourse(); } } c) public class Student { private Student s1 = new Course(); public void enroll() { s1.register(); s1.accessCourse(); } } d)public class Course { private Course s1 = new Student(); public void enroll() { s1.register(); s1.accessCourse(); } } e) public class Course { private Course c1 = new Course(); public void enroll() { s1.register(); s1.accessCourse(); } }
For the given sequence diagram,
Which of the following correctly implements the design?
a)public class Student
{
private Course c1 = new Course();
public void enroll()
{
c1.register();
c1.accessCourse();
}
}
b) public class Course
{
private Course c1 = new Student();
public void enroll()
{
c1.register();
c1.accessCourse();
}
}
c) public class Student
{
private Student s1 = new Course();
public void enroll()
{
s1.register();
s1.accessCourse();
}
}
d)public class Course
{
private Course s1 = new Student();
public void enroll()
{
s1.register();
s1.accessCourse();
}
}
e) public class Course
{
private Course c1 = new Course();
public void enroll()
{
s1.register();
s1.accessCourse();
}
}
Step by step
Solved in 3 steps