P = pineapple
O = orange
Pineapple is 7 times heavier than orange i.e.
P = 7O
Pineapple also weighs 870 grams more than the orange
I.e. P = O + 870
Substitute the equations.
7O = O + 870
7O-O=870
6O = 870
O = 870/6
O=145g
Plug this value back into original equation.
P=7*145
P=1015