Java Practice Assignment #2 – Employees

by Trevor Page on December 31, 2012

Before I get into the details of your next assignment, I’ll release my solution to the first assignment for you to look over and understand.

Click Here to Download Practice Assignment 1 Solution

Here’s a video with a full walk-through of my solution:

Assignment 2 – People, Employees and Organizations

Click Here to Download Practice Assignment 2

My goal for this assignment is to get you familiar with inheritance and the importance of dealing with the public methods available in the Java Object class. In practice assignment 2, you’ll learn how to use both an interface and an abstract class.

Important Notes:

  1. I’ve included two library files (JAR files) in the source code of this assignment. You still need to add them to the classpath when you extract this assignment and begin working on it. To do this, just right click on the Project and select Properties, then Java Build Path, then “Add JARs”, and navigate to the “src/lib” directory to add both JAR files.
  2. As with the first assignment there are Tests available that must pass. Currently they should all fail AND they will have compilation errors. The compilation errors are expected, as you’ll need to implement the appropriate methods from the interface and abstract classes (and then some). Once you’ve successfully coded the assignment, you won’t have any compilation errors and all the tests will pass. To run the tests, just right click on the “Tests” class name and select “Run As->JUnit test”.

Assignment Requirements

Okay so here’s the breakdown of the requirements for this assignment. You will need to develop a system that can track employee information for two Organizations (Google and Microsoft). The Employee information you must track is as follows:

  • Name
  • Sex
  • Job Title
  • Organization they work for
  • Birthday

As for the Organization that the Employee works for, you must also track this information:

  • Organization Name
  • Number of Employees

The system must be able to properly compare any two employees against each other to determine if they are the same Person. This means that if you compared two People with the same Name, Sex, Birthday and Organization, the system should think that they are equals to one another. If any of these properties are different, then the two People are not the same Person.

The same rules apply to comparing Organizations to one another. Organizations with the same Organization name are to be thought of as equal, different names means different organizations.

{ 11 comments… read them below or add one }

Leave a Comment

Powered by sweet Captcha

Previous post:

Next post: