Dealing with students who are underly-motivated Occasionally I have students who are 'under-motivated': they put way too little effort in to trying to memorize any of the textbook, any idea, each diagram I draw. I used to think that perhaps some people are "not suited" for some kinds of learning, but I threw that idea out: it is insubstantiable, and it is not my job to decide who is in the class anyway!

There is a raft of reasons why (adult) students could be having difficulties. They might have issues with medical conditions, medications, anxiety, depression, unstable home life, economic concerns... But these are not my purview either.

Assuming that the students can do the work if they work rightly, and that I can teach them if I teach rightly, what are some ways to deal with students who seem lost, have insufficient background knowledge, are unused to thinking in programming terms, who have issues with their energy, or are distracted... What are some effective ways to improve teaching in these situations (aside from the obvious of dealing with the cause, which is not in my scope).
You've mentioned before that your students are adults who are attempting to make a career change to a programming role. With that in mind, I think the best thing you can do is show them how what you're teaching helps them achieve that goal.

Think about it from their perspective: I'm an (older?) adult, who has had a "real job" for the last X years. Now I'm trying to change careers. I want to know how to get a new job, and how to perform the tasks of that new job. So it's hard for me to sit in a classroom and memorize stuff from a textbook and from lecture slides.

You and I know that memorizing that stuff will help them in their new careers, but that's not always obvious to students- especially novice programmers.

So my suggestion is to always make sure that your lessons directly tie into their goals. Find out what kinds of applications they plan on working on. Make the first assignment a very basic version of that. With each lesson, build on that assignment so that every step gets them closer to a "real life" end product.

Instead of saying "okay now you have to memorize that" and pointing to some lecture slides or a textbook chapter, ask "how can we improve our product?" and then show them concrete things they can do to make those improvements. The lectures and the textbook become references that help get them to their end goal, which I think is easier for professionals to digest.

For a concrete example, let's say your goal application is a point of sale system. Maybe your first application is a command-line program that mimics a basic transaction. Then the next assignment introduces variables by having different items with different costs. Then maybe the next assignment introduces if statements that apply coupons. Then you could have a lesson on creating a basic GUI, or using for loops to repeat actions, etc.

That's just a dumb example off the top of my head, but you get the idea: use your students' goals as a motivator, and tie your lessons directly into those goals. At the end of your course, students should have specific concrete usable information and a newfound ability to accomplish their goals.