Is the following the right way to do?
Let $G = Z/70Z \times Z/100Z \times Z/49Z \times Z/40Z$
Then its primary decomposition yields to : $$Z/(7 * 2* 5)Z \times Z/(5^2 * 2^2)Z \times Z/(7^2)Z \times Z/(2^3 * 5)Z $$ So: $$G(2)=Z/2Z \times Z/4Z \times Z/8Z$$ $$G(5)=Z/5Z \times Z/5Z \times Z/25Z$$ $$G(7)=Z/7Z \times Z/49Z$$
And $G \simeq G(2) \times G(5) \times G(7)$
ie $G \simeq Z/10Z \times Z/140Z \times Z/9800Z$
So the invariant factors of $G$ are 2, 140 and 9800.
The systematic method to convert a primary decomposition into an invariant factor decomposition is to list the powers of each prime in increasing order right justified and multiply them vertically (using the Chinese Remainder Theorem): \begin{array}{rrr} 2 & 4 & 8 \\ 5 & 5 & 25 \\ & 7 & 49 \\ \hline 10 & 140 & 9800 \\ \end{array} This coincides with your answer.