Last week I was doing one of the hour of code activities with a grade 3 class and I was impressed to see them learning about (and understanding) the use of subprograms. This was in the Minecraft activity. A grade 3 student was able to clearly explain to me how he was using subprograms (or functions as Minecraft calls them).
I have included a screenshot below of students incorporating the subprograms into their code. It’s a cool, simple way to introduce the topic. I thought this might be a fun way to introduce it to a high school class as well, it might be a neat warmup activity. You could link to this exercise which would likely take 10 mins for a high school programming student to work through – I would suggest having them work in partners so they can talk about what is happening.