Object Oriented Programming and Design with C++ Dr. Aaron Naiman
Course #15001301 <naiman@math.jct.ac.il>
Spring, 2006 Office hours: Monday, 13:30-14:30

Exercise Set #8


Define a class tax_payer. Give each object a name, and a random (between some minimum and maximum) level of craftiness. Also, have the tax_payer be in one of the following states: honest, cheater and jailed. Feel free to embellish.

Define also a class tax_collector. This class has a name as well, a random level of craftiness (not necessarily with the same extrema) and states: hunting and given up.

Hint: consider a base class for the two classes above.

Write a simulation to see how well two groups of such citizens fair against each other. Charge! You should randomize the group sizes and the individual match-ups. You may consider combined efforts. The contest ends when a group is wiped out. Make sure that you keep the user informed as to what is happening, including specific error messages, like trying to hunt a jailed tax_payer.