Discussion Questions
Tuesday of First Week:
Wednesday (Friday in Winter quarter) of First Week:
- Review Exercises R1.10 and R1.12
Friday of First Week:
- Review Exercises R2.10 - R.2.11
Monday of Second Week:
- Review Exercises R2.1 - R2.9
Wednesday of Second Week:
Friday of Second Week:
- R5.5 - R5.6, R5.8 - R.11, R5.13, and R5.14 (pp. 194 - 195)
Tuesday of Third Week:
- One can simulate the movement of a fish in an aquarium by
repeatedly flipping a coin. When "heads" is flipped, the fish moves
one foot to the right; when "tails" is flipped, it moves one foot to
the left. (We are assuming a long, narrow aquarium.) Assume that the
fish's initial location is labeled 0 and that locations to the right
are positive while locations to the left are negative. For example,
the fish in its initial location has left and right neighbors at
locations -1 and +1, respectively. What are the possible positions of
the fish, relative to its starting position, at the end of a
simulation with six coin flips? Explain. (Don't worry about the tank
being too short.)
- Conduct several such simulations, each with six coin flips as
described in the exercise above, and keep track of where the
fish ends up after each simulation. Is the fish more likely to
end up in one position than another? Explain why or why not.
- Typed Solutions:
(you don't have to print them just have them available
in lab)
R.6.2, R6.3 p.238
Wednesday of Third Week:
- R7.7 - R7.9 (Substituting ArrayLists for Arrays where
appropriate)
Friday of Third:
Monday of Fourth Week:
- R3.2 - R3.6
- Completed Object Diagrams
Tuesday of Fourth Week:
- Look over the implementation for the
AquaFish class in
AquaFish.java. You do not need to read all the method
implementations, but you should be able to find and identify the main
pieces of the class -- the declarations of instance variables, the constructors,
the public methods, and the private methods that are available only within
the class.
- Where is an object's state reprepresented in the
AquaFish
class?
- How many constructors does the class have?
- How many public methods does the class have? Does this correspond
to the class
documentation for AquaFish? Why, or why not?
- What private methods does the class have? Are they represented
in the class documentation? Why, or why not?
Wednesday of Fourth Week:
Friday of Fourth Week:
Tuesday of Fifth Week:
Monday of Sixth Week:
Wednesday of Sixth Week:
- Conduct a binary search on the arrray a given in the book on page
568 looking for the number 6. Which positions in the array would you
check using the algorithm on page 569-570?
- List an example when you would use a binary search and give an
example when a linear search would be better.
Monday of Seventh Week:
Wednesday of Seventh Week:
Monday of Eighth Week:
Wednesday of Eighth Week:
Wednesday of Ninth Week: