CMPU-235: Software Development Methodology
Homework #2
Due: Feb 9
I have good news and bad news.
The bad news is I was just called for jury duty. The good news is
that I got out of it. The bad news is that to get out of it, I
promised them some software to help with jury selection...and there's
just a little more bad news:
just in case you're not sick of bags yet, I am now officially passing
the responsibility for this software over to you.
Implement a software system for jury selection using the
bags class
you implemented last week. If you didn't get it working, now's your
chance.
The software should work as follows:
- It should begin by asking the user how many potential jurors have
been called.
- It should then prompt the user to type in the first and last
name and ss# of each potential juror.
- It should then iterate through the bag of jurors (again, bag
iteration is random), and for each one it should print the candidate's
name and ask whether the candidate is selected or not. Candidates who
are not selected are removed from the bag.
- After all the candidates have been considered, print out the
resulting jury. You do not have to check that the jury is the right
size.
In addition to incorporating your class into the software above, you
should also work on making your class efficient, both in terms
of space and time. In particular you should only call the random
number generator once for each element of the list - figure out a way
to accomplish this.