The AI Companion in Education: Analyzing the Pedagogical Potential of ChatGPT in Computer Science and Engineering