Bond order (B.O.) is defined as half the difference between the number of electrons in bonding ($$N_b$$) and antibonding ($$N_a$$) molecular orbitals:
$$\text{B.O.} \;=\; \dfrac{1}{2}\,(N_b - N_a).$$
It represents the number of bonds (single, double, triple) between two atoms. The higher the bond order, the shorter and stronger the bond and the more stable the molecule. A bond order of zero means no net bonding and the molecule does not exist.
(i) $$\mathrm{N_2}$$ ($$14$$ electrons). MO configuration (for N$$_2$$ the order $$\sigma_{2s}$$, $$\sigma^*_{2s}$$, $$\pi_{2p}$$, $$\sigma_{2p}$$, $$\pi^*_{2p}$$, $$\sigma^*_{2p}$$ is used because the $$\pi_{2p}$$ lies below the $$\sigma_{2p}$$ for $$Z\leq 7$$):
$$\mathrm{N_2}:\;(\sigma_{1s})^2(\sigma^*_{1s})^2(\sigma_{2s})^2(\sigma^*_{2s})^2(\pi_{2p_x})^2(\pi_{2p_y})^2(\sigma_{2p_z})^2.$$
$$N_b = 2+2+2+2+2 = 10$$;\;\; $$N_a = 2+2 = 4$$.
$$\therefore\;\text{B.O.}(\mathrm{N_2}) = \dfrac{10-4}{2} = 3.$$
(ii) $$\mathrm{O_2}$$ ($$16$$ electrons).
$$\mathrm{O_2}:\;(\sigma_{1s})^2(\sigma^*_{1s})^2(\sigma_{2s})^2(\sigma^*_{2s})^2(\sigma_{2p_z})^2(\pi_{2p_x})^2(\pi_{2p_y})^2(\pi^*_{2p_x})^1(\pi^*_{2p_y})^1.$$
$$N_b = 2+2+2+2+2 = 10$$;\;\; $$N_a = 2+2+1+1 = 6$$.
$$\therefore\;\text{B.O.}(\mathrm{O_2}) = \dfrac{10-6}{2} = 2.$$
(iii) $$\mathrm{O_2^+}$$ ($$15$$ electrons). One electron is removed from a $$\pi^*$$ antibonding MO compared to $$\mathrm{O_2}$$.
$$N_b = 10,\;\; N_a = 5.\quad\therefore\;\text{B.O.}(\mathrm{O_2^+}) = \dfrac{10-5}{2} = 2.5.$$
(iv) $$\mathrm{O_2^-}$$ ($$17$$ electrons). One extra electron compared to $$\mathrm{O_2}$$, placed in a $$\pi^*$$ antibonding MO.
$$N_b = 10,\;\; N_a = 7.\quad\therefore\;\text{B.O.}(\mathrm{O_2^-}) = \dfrac{10-7}{2} = 1.5.$$
Summary. $$\text{B.O.}(\mathrm{N_2}) = 3,\;\text{B.O.}(\mathrm{O_2}) = 2,\;\text{B.O.}(\mathrm{O_2^+}) = 2.5,\;\text{B.O.}(\mathrm{O_2^-}) = 1.5.$$