Be organized and specific about what is changing and what isn't and think it through:
- It is being heated, so is the temperature of the gas changing?
- It is a sealed piston, so is the mass of gas changing?
- The piston moves, so is the volume of gas changing?
- The weight of the bucket of shot isn't changing, so are you sure the pressure is increasing?
An answer of "yes" is a change in energy and a "place" where energy is going. You didn't actually develop a clear-cut problem here, so I'm going to assume the unknown you are trying to solve for is how far the cylinder moves, given a fully defined starting state and a given amount of heat addition. Along the way, you account for where the energy goes.
What kind of book did that come from and what is the context behind this? It feels like it should be part of a chapter in a thermodynamics book, on constant pressure heat addition:
https://en.wikipedia.org/wiki/Isobaric_process