CSU Long Beach
CECS 274
Programming and Problem Solving II


Syllabus
Schedule
Grading
Project 1
Project 2
Solution to Project 2
Project 3
Solution to Project 3
Project 4
Solution to Project 4
Project 5
Set Solution to Project 5
Map Solution to Project 5
Lecture Notes
Basic Unix Commands
Basic vi Commands
More vi Commands
Using Eclipse
Compiling and Running Java on Unix


Mimi Opkins Home

Project 5

Assignment

  • For this assignment you will be writing two different programs - one dealing with sets and one dealing with maps.
  • The first program will deal with sets. You will create an OrderedName class. Create that class so that names are sorted by the lastname, then the first name then the middle initial. Two people with the same names will be considered to be the same object. You will need to override the inherited hashcode(), equals() and toString() methods. You must also implement the Comparable interface for the sorting to work.
  • Create a test program that adds names to an appropriate set data structure then prints them out in order.
  • The second program will deal with maps. Create a program that reads in a file, counts the number of times each word appears in the file. Print out the words and the number of times that they occur in alphabetical order.
  • Make sure you document the program as specified in the grading guidelines. Document the methods describing their purpose, input and output.
  • You will hand in a printout of the program(s), sample output and a UML class diagram along with a demo in the lab.

Grading Criteria

    You will be graded on the following components:
  • Does the program do what is required
  • Is it properly documented
  • Is it fully tested
  • Is it properly designed