Answer
The compounds from lowest lattice energy to highest lattice energy: $$KI\lt LiBr\lt MgS\lt GaN$$
Work Step by Step
1) The ions in $MgS$ compound are $Mg^{2+}$ and $S^{2-}$
The ions in $KI$ compound are $K^+$ and $I^-$
The ions in $GaN$ compound are $Ga^{3+}$ and $N^{3-}$
The ions in $LiBr$ compound are $Li^+$ and $Br^-$
2) As we have shown in part (a), the lattice energy of a compound is directly proportional with the charges of the ions in the compound. That means if the compound has higher-charged ions, its lattice energy is higher.
Therefore, we can immediately witness that the ions in $GaN$ compound are highest-charged ($+3$ and $-3$), then come the ions in $MgS$ compound ($+2$ and $-2$), the lowest-charged ions are those in $KI$ and $LiBr$ compounds ($+1$ and $-1$).
That means the lattice energy of $GaN$ is the highest, then comes the lattice energy of $MgS$, and the lowest lattice energy is that of $KI$ and $LiBr$.
3) Since the charges of the ions in $KI$ and $LiBr$ compounds are equal, we would consider the distance among the ions in both compounds.
The distance among the ions in a compound can be calculated from the ionic radii of those ions.
As we have learned from chapter 7, as we move down a column in the periodic table, the ionic radii would increase. Since both $K^+$ and $I^-$ are below $Li^+$ and $Br^-$ in the periodic table, the ionic radii of $K^+$ and $I^-$ are larger. So $K-I$ distance is larger than $Li-Br$ distance.
From part a), lattice energy is inversely proportional with the distance among the ions. Therefore, the lattice energy of $K-I$ is smaller than that of $Li-Br$.
4) In conclusion, the compounds from lowest lattice energy to highest lattice energy: $$KI\lt LiBr\lt MgS\lt GaN$$