I just solved similar type of question. You can refer to my solution which I have attached
Answer:
Gravity is dependent on the mass of two bodies and the distance between them. There is a strong gravitational attraction between Earth and the Moon because they’re relatively close to one another. There is a strong gravitational attraction between Earth and the Sun because the Sun is so massive