There are two groups A and B of a class, consisting of 42 and 28 students respectively. If the average weight of group A is 25 kg and that of group B is 40 kg, find the average weight of whole class?
[A] 30 kg
[B] 31 kg
[C] 42 kg
[D] 45 kg