This website is preserved for historical and scholarly reference and is no longer actively maintained.
CpSc 210, Section 1
Assignment 6
16 June 2000
Due: Friday, June 16 at midnight
Late penalties: 20 points per partial day late. That is, programs
turned in after midnight Friday and before midnight Saturday
will have 20 points deducted for late, programs turned in after
midnight Saturday and before midnight Sunday will have a total
of 40 points deducted for late, etc. Since this assignment
uses the Drawing Window, you should give considerable attention
to getting the assignment in early if you cannot use the
Drawing Window from a remote location.
Total point value of assignment: 100 points
Late submissions not accepted after: Monday, June 12 at midnight
This assignment is to be done INDIVIDUALLY.
Create a directory, A6, which will contain all parts of this assignment.
(In this assignment the directory A6 will contain a file
named Asg6.java.)
Assignment:
Problem 3.10 (page 48). Finish the two-dimensional Vector-like
structure Matrix. Each element of the Matrix is indexed by two
integers that identify the row and column containing the value.
Your class should support a constructor; methods addRow and
addColumn that append a row or column; the elementAt and
setElementAt methods; and width and height methods. In
addition, you should be able to removeRowAt and removeColAt.
(Note: the method name is removeColAt, not removeColumnAt.)
Two additional methods are needed:
public boolean equals ( Matrix other )
// post: returns true if this contains identical information
// to other; otherwise, returns false.
public String toString()
// post: returns a String representation of the Matrix.
// representation may contain newline characters (\n).
Input:
Input should be contained in your test program (main).
Use the ReadStream class (page 334) that is part of Bailey's
structure package for both input and output.
Output:
Print your name, the assignment number, and a short description
of the assignment. Use the System.out commands.
Output should be contained in your test program (main).
Your class will also be tested with other test program(s).
Other requirements:
Follow the style standards to be found on your instructor's
web page for CPSC 210.
Submit your program using the handin command. There is a link to
the handin description on your lab page (www.cs.clemson.edu/~lab210).
Grading rubric:
Required documentation 10 pts.
Style standards 10 pts.
The program compiles without error. 10 pts.
If the program does not compile, no further points will be awarded.
Correct Methods:
width 5 pts.
height 5 pts.
equals 10 pts.
toString 10 pts.
insertColAt 10 pts.
addRow 5 pts.
addColumn 5 pts.
removeRowAt 10 pts.
removeColAt 10 pts.