Chidamber and Kemerer define Lack of Cohesion in Methods as the number of pairs of methods in a class that don't have at least one field in common minus the number of pairs of methods in the class that do share at least one field. When this value is negative, the metric value is set to 0.
Note 1: I have only included methods if they access at least one field.
Note 2: I have only included fields if they are accessed by at least one method in the class.