This assignment is worth 20 points.
The government of WA-TOR has hired your company to conduct a geographical survey of the planet, and you are to write the software to support this survey. As there are several other planets in the area with the same shape, you have decided to write a generic program to perform this task.
Your company has a satellite that circles the planet taking photographs, which are then assembled into a map. These maps, stored in one bit per pixel, record land sectors as a 1 and water sectors as a 0. One of WA-TOR's moons, Chessious, has the following survey map.
16 16 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 1As you will notice, Chessious appears to have 8 land masses, each of area 12 square units. The government of WA-TOR has defined an land mass to be a collection of 8-connected land sectors. Note a land mass can extend across the edges of a map. (The moon Addor, below, has one land mass.)
5 5 0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 0 0 1 0 0 0 0 1 0 0
To simplify the process of aligning a map with a planet, your company places a reference pin, called the "top pin", in the planet. This pin is the reference point for all maps, and is given the coordinate 0,0. For any survey map, this pin will be in the upper left hand corner of the map.
Finally the government has established the following naming scheme for land masses. Starting at the top pin and heading west, the first land mass encountered is called "A", the next "B", until Z. After land mass Z, the naming continues with AA, AB, ... AZ, BA, BB, .... When you reach the top pin, sail south for one sector and repeat the process. Therefore the moon Chessious would have land masses named as follows:
AA BB AA BB C DD C C DD C EE FF EE FF G HH G G HH G
Your program is to read a map and compute the following information:
Files should be named as follows.
You must use the standard algorithm library function sort to perform your sorts.
You must implement a matrix class to store the planetary data. I would make the dereference function "fix" any errors in indexing.
Do not make any assumptions about the size of the files. A planet must have at least one sector, but may be very large.