COSC 071
Project 4 Part 1

No due date nor anything to be turned in for Part 1. Part 2 will be posted before November 12, and it will be to your advantage to have Part 1 done before then. The whole project is due, by the normal submission process, by the beginning of class on November 19th.

The northen elephant seal is a pinneped that was hunted almost to extinction in the 1800s for the oil rendering their copious blubber produced. A colony of a few tens of individuals was discovered off the coast of Mexico in the 1920's and protected from further hunting. Since then, their population has recovered, and there are over a hundred thousand individuals descended from the single colony.

Researchers are studying the mating habits of these animals They have asked you to help them write a program that they can use to track paternity of seal pups.

The information that they track for each elephant seal is an integer number that is unique to each individual(and is often marked directly on the animal's fur in dye), a bit string of 16 bits that represents the the presence or absence of 16 individual genetic markers in the animal's DNA, and the animal's weight in kilograms. The DNA markers are used to determine paternity. Because the elephant seals are descended from such a small group, their DNA is very similar. Paternity is indicated by all 16 markers being the same.

Your first task is to write a complete class description that can be used to store information about individual elephant seals. It should include reasonable constructors and destructors, observers and accessors for each private data member, and a method that can, given another seal object, determine if one seal is related to the other and returns a boolean value of true if they are. It should also include overloaded operators to allow easy input and output of seal information. Seal information will be provided in the following form:

< ID mark > < DNA bit stream > < weight >

< ID mark > will always be an integer, zero or greater.

< DNA bit stream > will be a hex value, 0x32fe for example. 0x00 is not a valid value, as all seals will show the presence of at last one genetic marker.

< weight > will be a floating point value, obviously greater than zero. A zero value is used to indicate an unknown weight (it is hard to get a 2000+ kg animal on a scale, but you can do it with the smaller pups).

Output for each seal should be in the same format.

Extra credit:

While an exact match of the DNA bit stream represents a direct blood relationship, in some cases elephant seals can be related even if one marker is not the same. However, if more than two markers are not the same, the animals are not related.

For extra credit, write a method that will return true if the two seals have either the same genetic markers or the markers differ only in one place. Otherwise, the method should return false.

The extra credit must be done on your own. You may not consult with others in the class or outside, and the TAs have been instructed not to assist you with the extra credit section. I assure you that it can be done using things that have been covered in class.

If you do the extra credit, the method you create should replace the one that determines relationships in the main program.


Project 4 Part 2

Now that the seal class is done, it is time to integrate it into a larger program. An more experienced programmmer, who has written a similar program for tracking whale populations, has provided an outline of other classes and a main function that you should use to finish the program.

The program you will write will allow reserachers to track elephant seal pups and elephant seal males who might be their fathers. The users of your program will be able to add information about seal pups, about possible fathers, save that information into files, load files with that information, and run through the loaded data to determine possible paternity information. A sample run is available, as are sample fathers and babies files.

Again, your program is due November 19th, by normal electronic submission, before class.