Description
Objective
In this lab, you will practice the process of problem solving and coding when you may not have all of
the details of the problem. For some, this will seem easy. For others, there will be some challenge to
grasp everything within the lab time.
Working independently or in groups of two students, you will write code to implement a Map data
structure in Java.
A Map is a structure that stores key-value pairs, meaning that you want to store and retrieve pairs of
data. The first bit of data is called the key. The second bit of data is called the value. Given the key,
you can retrieve the value associated with that key. Keys are unique to the Map (meaning that you
can’t have two entries with the same key) while values are not unique (meaning that you can have two
keys that map to the same value).
In addition to a constructor, you should implement the methods get and put for your Map.
In your implementation, you cannot use any of the existing Java Map classes.
Preparation
Ensure that you have your Integrated Development Editor (IDE) for Java installed.
Resources
None required.
Procedure
Set up
None.
Lab steps
1. Ensure that you and your partner agree on an understanding of the problem.
2. List the elements of the problem statement that are not defined sufficiently-well to begin an
implementation.
1
3. Select a resolution for the missing parts of step 2.
4. Decide on the approach you will use to implement the methods
• How you will store the data
• What difficulties you will expect
5. Implement your solution.
Analysis
Identify how you will know that your implementation is working.
Reporting
1. In one file, list
• Your team members
• A list of items from the description that needed clarification
• Your decisions on the items that need clarification
• How you showed that your work (so far) is working
2. In that same file, briefly describe either
• How you would approach this problem differently if you had to start new; or
• What you did well in developing the implementation that you could use as an approach to
implementing another problem.
3. Generate a PDF from the document.
4. Submit the PDF and your Java files in Brightspace in the Lab/Lab 1 section of the course page
in Brightspace.
Note: Only one member of the group needs to submit the report.
Assessment
The assessment will be on a letter grade and will reflect how well you are demonstrating and executing
on problem solving techniques that could be used in other situations. I am more concerned with your
thinking about how to get a solution than on the code being complete solution.
2
Letter grade Items that
needed clarification
Decisions on
items for clarification
Implementation Demonstration
of work so far
Looking forward
A
(Excellent) Have thought
through all the
aspects of the
problem .
Resolution for
unclear items
are well thoughtout based on
future direction
of the work
The map implementation is
complete and
well-done. Well
documented
and easy to
build on later.
Guards against
input validation
problems.
There is a definite plan on how
to show that the
code works. All
the cases are
covered.
Have a strategy
that will carry
forward to other
problems.
B
(Good) List of items
is relatively
complete.
Reasonable
conclusions
made about
each unclear
item, along with
signs of thinking
through the
conclusions.
The map implementation
is complete
and has all
the relevant
functionality
working.
There is some
notion of what’s
needed to show
the code is working. May not
be fully implemented here.
Have identified
what worked
or should have
worked in this
problem.
C
(Satisfactory) There are
enough key
items identified
to get started,
but more will
arise as you
proceed.
There is a
consistent set
of conclusions
made for the
items.
General framework of the
implementation is in place
and the major
components are
done.
Has a notion of
using testing on
the code. Incomplete set of
tests.
Show an awareness that some
things might
make it easier
or harder, but
may not be able
to identify them
clearly.
D
(Marginal Pass) Approach seems
to be to find the
items as you go .
There is some
resolution to the
items, though
some may
At least one of
the methods is
in place and on
track to be working.
Provide some
argument with
some basis on
why the code is
working. Nothing formal or
complete.
Minimal awareness that the
strategy by
which we approach a problem can make a
difference on the
solution.
F
(Inadequate) No discussion on
items to clarify.
Lack of clarity
on the resolution
of the items.
Little code is
done and/or is
not in a state to
work.
Little convincing argument
beyond an assertion that the
code works.
Little awareness of what
can make the
problem solving
process go well.
3