I have been teaching various subjects in programming for a couple years. What I struggle with most is getting the students engaged in the basics - the first few lectures.
For example, it's simpler to come up with a design pattern or a hands-on project when you are talking about intermediate or advanced subjects like database connectivity, security, networking, and so on. There's so much more to work with in those later topics. Where I have trouble is with the absolute basics - the data types and basic logic statements. It's hard to think of a sample project that is simple enough to build without getting too advanced too quickly, but still enough of a challenge to get them experience with the basics.
I get a lot of comments from students saying that they learn the material better when there is a hands-on project to do, yet for something as simple as data types, this is difficult to come up with.
Class Setup: It is a professional setting and I have been given two different formats to use. One format is an hour lecture with an hour lab or coding exercise afterwards, once a week, and the other is a condensed workshop format where students watch videos on their own about the material and then they come to a workshop for Q&A about the video content, and then we spend most of the time on a lab or exercise. The videos take the place of lectures, that way we have more time in class for in-person interaction and Q&A during hands-on project work. The workshops are two hours long, and take place every three weeks, and the videos they watch cover material from three of the subject units from the standard format.
Class Scope: As for the class topics, the class is on Java and we go from the very beginning, primitive data types and logic, for those who have never used Java or even studied programming, then we move on to object oriented design, logging and string processing, collections and streams, working with input/output, exception handling, working with tools like Eclipse and Maven, writing test code, and by the end of the class we go through database operations, security and threading, web services, and more advanced language topics like generics and lambda expressions.
Audience: The audience varies pretty widely but everyone has at least a bachelor's degree in a technical field, most of them in computer science or CIS. It is as varied as your average IT workplace would be.
Does anyone have any ideas, or know of a coding project (of any size) that would be effective at helping students grasp the more basic subjects (like data types, language syntax, and logic), and yet interesting enough to keep them engaged and want to finish it?
EDIT: As suggested by eykanal, I reverted this question to its original form which is specific to computer science. I understand that when a question concerns graduate level pedagogy as this does, it is still on-topic.
EDIT2: I've added more information about the class setup and audience that I typically work with.
We basically made a one dimensional battleship game just to start with, then converted it to 2D and talked about data types and arrays and such, then converted it to an object oriented design, then upgraded it to have saved games (for I/O and exception handling material), etc.