Also, the simple rule is, the audible phoneme (sound) immediately preceding the final S determines whether the S is voiced or unvoiced, as the S simply follows its pattern:
dog - dogs (/z/ because /g/ is voiced)
cat - cats (/s/ because /t/ is unvoiced.)