
10.10 Exercises,Problems,and Projects 729
EXERCISES,PROBLEMS, AND PROJECTS
38. Write a class encapsulating a board game, which inherits from Game.
A board game has the following additional attributes: the number of
players and whether the game can end in a tie. Code the constructor
and the toString method of the new class. You also need to include a
client class to test your code.
39. Write a class encapsulating a sports game, which inherits from Game.
A sports game has the following additional attributes: whether the
game is a team or individual game, and whether the game can end in
a tie. Code the constructor and the toString method of the new class. ...