Calculates the check digit for a 13-digit product code. (Demonstration for UC Computational Thinking course)