Instructions: Answer the following questions one at a time. After answering each question, check your answer (by clicking on the check-mark icon if it is available) before proceeding to the next question.
Getting Ready: Before going any further, you should:
downloads directory/folder). In most browsers/OSs, the
easiest way to do this is by right-clicking/control-clicking on
each of the links above and then selecting CourseTime and CourseSchedule classes.
CourseTime
and
CourseSchedule
classes.
CourseTime at (or after) 9:05 on MWF and prints
its String Representation.
import java.util.Iterator;
public class Driver
{
public static void main(String[] args)
{
CourseSchedule mwf = new CourseSchedule(8, 0, 50, 15, 10);
CourseSchedule th = new CourseSchedule(8, 0, 75, 15, 7);
}
}
What code did you add?
CourseTime at or after 9:06 on MWF.
What code did you change/add?
CourseTime on MWF. What code did you change/add.
CourseTimes on MWF. Specifically, construct
a CourseTime that corresponds to the first possible
CourseTime and then use information from
the CourseSchedule to construct the next
two CourseTime objects. What code did you
change/add?
CourseSchedule. Instead,
make use of the fact that, as you saw
earlier, CourseTime objects are "rounded up". What
code did you add?
CourseTimes on MWF. What code did you change/add?
CourseTimeIterator illustrated in the
UML diagram above. What code did you write?
CourseTime class so that it is consistent with the
UML diagram above. What code did you change/add?
Iterator
to print all of the MWF CourseTimes. What code did you
change/add?
CourseTimeIterator
class. For example, the implementation above uses the isLast()
method in the CourseTime class. Create an implementation that
does not. For example, create one that uses the compareTo()
method. What code did you add?
Copyright 2025