Using your ratios:
8in=?mm
40in=1016mm so ratio is 1in=1016/40=25.4mm
So 8in=8*1 in=8*25.4mm=203.2mm, answer D.
Another way to do it: if 40in=1016mm, then divide by 5: 8in=1016/5=203.2mm, answer D.
Using my ratios:
2.54cm=1in. 8in=8*2.54cm=20.32cm.
1cm=10mm, so 20.32cm=10*20.32mm=203.2mm, answer D.
See, the answers are all the same! That means there is often more than one way to solve the same problem.