Homework 15
CSSE 221 – Fundamentals of Software Development Honors
Fall 2008–2009
Recall the
Due Dates
and
(from the syllabus)
the
Late (and early) Assignment Policy
and guidelines for
maintaining Academic Integrity.
Also recall that you can get help on any of these problems during the
CSSE lab assistant hours,
and you can use the Assignments Discussion Forum
on Angel to discuss, clarify, or get help on these problems.
Things to do
- Continue working on your CarsTrucksTrains project,
using pair programming throughout (except for implementing
the Truck and Train classes, which you should do separately).
You should have completed most, if not all, of this project by the due date of this homework.
- Do the written problems below.
Written problems
Write your answers to these questions.
Turn your answers in via the appropriate Homework Drop Box on Angel.
-
Consider the four core interfaces, Set, List, Queue, and Map,
as described in the Java Tutorial's Collections Trail at:
http://java.sun.com/docs/books/tutorial/collections/index.html"
For each of the following four assignments, specify which of the four core interfaces is best suited,
and explain how to use it to implement the assignment.
Don't actually DO the assignment -- just state which
interface (Set, List, Queue or Map) you would use and (in a sentence or less) why.
(Note: this problem is taken verbatim from the Collections Trail.)
- Whimsical Toys Inc (WTI) needs to record the names of all its employees.
Every month, an employee will be chosen at random from these records to receive a free toy.
- WTI has decided that each new product will be named after an employee
— but only first names will be used, and each name will be used only once.
Prepare a list of unique first names.
- WTI decides that it only wants to use the most popular names for its toys.
Count the number of employees who have each first name.
- WTI acquires season tickets for the local lacrosse team,
to be shared by employees. Create a waiting list for this popular sport.