CSci 581-01: Special Topics in Computer Science
Object-Oriented Design & Programming
Spring Semester 1999
Instructor's Bulletin Board
25 January 1999: Input/Output Packages
On the course Resource Links page, I
gave links to the corejava
package associated with Horstmann and Cornell's Core Java 1.2
books (Addison-Wesley, 1999). You may find the
Console
and Format
classes useful.
I also gave links to the Text
class from the book
Java Gently: Programming
Principles Explained, Second Edition (Addison-Wesley, 1998).
You might find it useful.
21 January 1999: Assignment #1
Assignment #1 was handed out in
class today. It is due on Thursday, 4 February.
This is not a particularly difficult assignment. My purposes are:
- To give those students who have previously programmed very little
in Java a chance to learn the basics of the language.
- To get all students to think about implementing abstract data
types in Java, perhaps in a more precise way than they have
previously.
Note that I do want the classes and methods specified using
preconditions, postconditions, and invariants. You might consider
using my Assert
class (or something similar of your own) to check for
preconditions, etc.. You might want to use Javadoc to document the
code. Etc.
If any of you are looking for more of a challenge, you might think
about developing the program, in particular the BingoCard
and GameCards
classes, as an "application framework" for
a whole class of Bingo-like games. By application framework, I mean a
set of base classes, interfaces, and library classes that can be
extended, implemented, or used to provide different specific games.
Here are some ideas--perhaps all cannot coexist within the same
design.
- Consider changes like making the size of the board variable,
making the techniques for initializing the board, ranges on values,
etc., something that can be done in different ways (e.g., in an
overridden method), etc.
- The row, column, and diagonal winning patterns are not the only
ones used in Bingo. Perhaps allow design the class where different
winning pattern detection techniques can be "plugged into" the class
in some way. You may need to do some research into what different
kinds of patterns are used in varous Bingo games.
You might want to investigate the Template Method and Strategy design
patterns for ideas on how to implement this (and other of the possible
enhancements).
- Consider using a general class of objects for the labels in the
Bingo grid, not just primitive ints. Since an equality operation is
needed you will need to define an appropriate base class or interface
to represent this hierarchy labels.
- I implied a simple text-based display of the bingo card. If you
like graphics, you might consider having the game to have a
"real-time" display of bingo cards on the screen. This capability
should not be built directly into the BingoCard class but should be a
separate class that gets its information from a BingoCard instance.
You would probably need to be able to selectively choose cards to
display, since all in a GameCards class will not likely fit on a
screen at once.
If you do this, please try to stay with standard Java graphics.
- Etc.
Don't try something sophisticated until you are sure you can deliver a
good solution to the basic problem
Finally, if you have a programming problem you would like to tackle,
then let me know. I could perhaps substitute it for this one, but
more likely I might consider it for future individual or group
programming exercises.
UP to CSCI 581 root document?
Copyright © 1999, H. Conrad Cunningham
Last modified: Wed May 12 07:31:02 CDT