CS 136 Tutorials - Spring 2007

Tutorials »

Tutorial 12: Double Arrays and Polymorphism (July 20)

Today's tutorial covers two topics that are central to your success on the final assignment: two-dimensional arrays and polymorphism. These were covered in lecture modules 10 and ll (see handouts).

  1. Double Arrays
  2. We will be implementing a class GradeBook, which stores marks for a number of students for a number of assignments by using a 2D array. Stored are the names of each student, the marks of each student on each assignment (the 2D array), and the maximum score for each assignment. The methods you are to implement are:

    Details for these methods can be found in the comments of the skeleton code. The first 6 methods (including constructor) must be implemented for the tests to function properly. Then you can try implementing any of the other methods and test your implementation with the provided GradeBookTest class.

  3. Polymorphism
  4. Included in the skeleton code are two classes, Sequence and SequenceUtils. The first is a class to represent arithmetic sequences, with an iterator-like implementation. SequenceUtils just contains a few methods to perform some basic operations on a given Sequence object.

Last modified on Wednesday, 09 January 2019, at 14:31 hours.