o=2a+2,
o/2-a/2=4 this is your system of equations,
It you wish to solve for apples, then simply substitute o from the first equation into the second equation...
(2a+2)/2-a/2=4 multiply both sides of the equation by 2
2a+2-a=8 combine like terms on the left side
a+2=8 subtract 2 from both sides
a=6
So Javier has 6 apples in the basket.