Starting from:
$35

$29

Lab 1: Basic Problem Solving Solution


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 rst 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 de ned su ciently-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 di  culties you will expect

    5. Implement your solution.


Analysis

Identify how you will know that your implementation is working.


Reporting

    1. In one  le, list

Your team members

A list of items from the description that needed clari cation Your decisions on the items that need clari cation

How you showed that your work (so far) is working

    2. In that same  le, brie y describe either

How you would approach this problem di erently 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 les 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 re ect 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
Decisions
on
Implementation
Demonstration
Looking forward

needed clari ca-
items for clari -






of work so far






tion




cation


















A

























(Excellent)
Have
thought
Resolution
for
The

map
im-
There is a de -
Have
a
strategy

through all
the
unclear
items
plementation
is
nite plan on how
that
will
carry

aspects
of
the
are well thought-
complete
and
to show that the
forward to other

problem .


out
based
on
well-done.
Well
code works.
All
problems.







future
direction
documented

the
cases
are











of the work

and

easy
to
covered.

















build
on
later.




















Guards
against




















input
validation




















problems.












B

























(Good)
List
of
items
Reasonable

The

map
im-
There
is
some
Have
identi ed

is

relatively
conclusions

plementation

notion of what’s
what

worked

complete.


made

about
is

complete
needed
to
show
or
should
have






each

unclear
and

has
all
the code is work-
worked
in
this






item, along with
the


relevant
ing.

May
not
problem.







signs of thinking
functionality

be
fully
imple-











through

the
working.



mented here.












conclusions.
















C

























(Satisfactory)
There


are
There
is
a
General

frame-
Has a notion of
Show
an aware-

enough


key
consistent
set
work
of

the
using testing on
ness
that
some

items
identi ed
of
conclusions
implementa-

the
code.

In-
things
might

to
get
started,
made

for
the
tion
is in
place
complete
set
of
make
it
easier

but
more

will
items.


and

the

major
tests.



or
harder,
but

arise
as

you




components
are





may not be able

proceed.






done.









to identify them





















clearly.


D

























(Marginal Pass)
Approach
seems
There
is
some
At
least
one
of
Provide
some
Minimal
aware-

to be to  nd the
resolution to the
the
methods
is
argument
with
ness
that
the

items as you go .
items,
though
in place
and
on
some
basis
on
strategy

by






some may

track to be work-
why the code is
which

we
ap-










ing.





working.
Noth-
proach
a
prob-
















ing
formal
or
lem can make a
















complete.


di erence on the





















solution.

F

























(Inadequate)
No discussion on
Lack
of  clarity
Little
code
is
Little
convinc-
Little

aware-

items to clarify.
on the resolution
done
and/or
is
ing

argument
ness
of
what






of the items.
not in a state to
beyond
an
as-
can

make
the










work.




sertion
that
the
problem
solving
















code works.

process go well.


















3

More products