Calculating Entropy of a file and coding it using Hamming

I am trying to solve a problem for a project i took and i am in the final part of it...(view below for my until now code)

Well the aim is to calculate the entropy of a file and then to use Hamming to code it. I managed to make both parts based on what I learned from the class and read in the book. (Please if you are familiar with the object tell me if it is correct )

So, my problem is that I am not able to merge those two parts below (you don't need to read the theory for it).. like finding the entropy and then continue for the coding of that file.

I agree with Saswat - how can this be your code? You cannot possibly have written code like that if you haven't got a clue how to "merge" it or even to explain what you mean by that.

Out of interest I tried Googling "hamming jiaoyan" and it seems you've been busy posting this on lots of different forums with exactly the same response at each: what are you talking about, and in each case you failed to clarify.