The solution requires two equations.
let x = kilograms of apples, and y = kilograms of bananas
1. we know that xkg + ykg = 9kg
2. from this equation, we see that ykg = 9kg - xkg
3. we see that $960 = $80x + $140y
4. we substitute the value for y from the first equation to get
$960 = $80x + $140(9kg - xkg)
then, $960 = $80x + $1260 - $140xkg
combining, we get -$300 = -$60xkg
we multiply both sides by -1 to get $300 = $60xkg
solving, we get x = 5kg, so y = 4kg