If you are assigned to teach a computer science course then, you would come across students that are not so fond of their choice of study. Not everyone enroll into a specific program by choice but, some might be inclined to study CS by chance or by mistake. If the student is not interested then, it is up to a teacher to teach the fundamentals of computer science to its students and to make it interested in learning the objectives of the subject.1) Understand their concerns
Keeping the complexity of the subject in mind, the students tend to get confused and they might potentially want to switch their courses. It is an understandable concern; however, as a professor you should be familiar with what exactly attributed to the confusion of the students. Maybe the students are expecting support from you, so you should be supportive of their confidence and concerns to gear their interested towards understanding computer science.2) Offer a streamlined approach
If you are asked to teach a computer science course, and you tell your students to learn everything and anything in the books then, they would lose their interest. Instead, you should prepare an outline that covers the essential sections of the course. A student is not required to study everything in the book—it is not practical. Instead, prepare an outline and recommend the chapters that would be beneficial to a student in the long run.3) Give one-on-one lessons
If you feel that your students have started losing interest in the subject, all you can do is to provide them with one-on-one lessons. Sit down with them, and ask them about their concerns regarding the subject, and pinpoint the issue that is responsible for making them lose their interest in the subject, and talk them out of it wisely.