I would do this by find a scale factor for each figure, and then find the missing side length.
5) scale factor is k =16/40 =2/5
So if the side of the bigger figure is 25, the complimentary side of smaller side.
So 2/5 = x/25 - the x is our missing side length. So the x = 10
6) k= 4/8=1/2
It’s gonna be an easy one. So if the side of the bigger is 12, the complimentary side of the smaller figure will be 2 times smaller, so it should has 6.
7) k=5/10=1/2
The same situation - the complimentary side of the smaller figure should be 2 times smaller Than the bigger one. So when the smaller one is 7, the bigger side should be 2 *7 = 14