To find the average weight of the whole class, we need to take into account the number of students and their weights in each section. Let’s assume that the average weight of the whole class is ‘x’ kg.

The total weight of all the students in section A is:

Total weight of section A = Number of students in section A x Average weight of section A = 36 x 40 = 1440 kg

Similarly, the total weight of all the students in section B is:

Total weight of section B = Number of students in section B x Average weight of section B = 44 x 35 = 1540 kg

The total weight of all the students in the class is the sum of the weights in section A and section B:

Total weight of all students = Total weight of section A + Total weight of section B = 1440 + 1540 = 2980 kg

The total number of students in the class is the sum of the number of students in section A and section B:

Total number of students in class = Number of students in section A + Number of students in section B = 36 + 44 = 80

Therefore, the average weight of the whole class can be calculated as:

Average weight of class = Total weight of all students / Total number of students in class = 2980 kg / 80 = 37.25 kg

Hence, the average weight of the whole class is 37.25 kg.