ART MOMENT:
.
![]() |
With student id, museum tickets cost only $8 |
At the end of today's class you should
HAVE READ:
KNOW:
BE ABLE TO:
DAILY QUESTION:
No Daily Question. Not enough planning!
Sample Exam question(s)
A course taught at WPI is taught by a single professor and has a number of students enrolled in that course. There are two types of courses: Undergraduate courses (seven weeks long) and graduate courses (14 weeks long).
(A) ![]() |
(B) ![]() |
(C) ![]()
|
(D) ![]() |
Ans: The arrow with a Triangle describes the inheritance relationship. For example, in Choice A, it shows that class UndergradCourse is a derived class of Course. A Straight line between two classes represents an association, which is either (one::one, one::many, or many::many).
Now, choice D describes a situation where a professor teaches any number of courses, each of which can have a number of students; note that these students themselves may each be in any number of courses [not restricted to just a single course]. Note also that each course is restricted to being taught by a single professor. Finally, there are two types of students -- graduate students and undergraduate students.
Choice C suggests that the Course be a derived class from two base classes. However, in Java, we know that there can only be single inheritance, so this choice is discarded.
Choice B seems to state that a Course is a type of Professor; we discard this one
Choice A describes how a professor teaches a single course, and that course is taught by a single professor. In this class there can be any number of students, but each student belongs to exactly a single class. There are two types of classes: undergraduate and graduate classes.
Now that we have described each of these, the one that seems most related is choice A. Why? Because choice B & C are discarded and choice D creates different types of Students, while the problem is asking us to consider different types of courses.