CSSE 221: Fundamentals of Software Development Honors
Programming assignment (due by Saturday, 11:59pm)
Finish TBA, as stated in the specification, being sure you have checked in your final,
fully-documented copy to the repository.
Written homework to do before week 5 (due before beginning of class on Monday, Oct
1).
Answers are to be written in your own words!
As usual, please bring hardcopy for written answers to class to hand in on Monday.
- Complete all the reading.
The next 4 questions are covered in the reading from the last couple weeks. They'll help prepare you for Exam 1 next week.
- (5 pts) Weiss 1.15 (Weiss uses this construct in later chapters, so you should recognize it)
- (5 pts) Weiss 2.6 (toString). Explain the output. (You can run this if you want.)
- (10 pts) Weiss 2.11 (resize array in method) Again, you can run the code and verify that it doesn't work,
but you need to explain why not.
- (10 pts) Weiss 4.9 (interface vs. abstract classes)
- (10 pts) Weiss 4.14 (local and anonymous)
- (40 pts) Weiss 4.29 and 4.30 (function objects). On 4.30, EqualsK should implement your
interface from the first problem. Add extra tests to your main method to
create some different equalsK objects and pass them, along with an
interesting array, to the countMatches() method. Hints: you may find it
helpful to draw an analogy with the SimpleRectangle example I presented in
class: countMatches (like findMax) is the method that takes an array and a
function object as parameters. EqualsZero (like findMaxByWidth) is specific
function object. ??? (like Comparator) is the function object interface: you
pick the name of the interface you'll write. Note: please call your project:
WeissCountMatches and do a Team>Share to submit it to the repository
for grading.