The purpose of this activity is to present musical challenges to your students that encourage them to solve a problem through inquiry, preferably with a keyboard or tablet.
This activity is basically chord-based melody writing. You may need to do a lead up exercise with chord-based composition so your students understand this routine. The fifth bar of the eight bar melody would typically have a C chord. See if your students can come up with an alternative chord by playing, experimenting and listening to the whole piece with their choices.
(Depending on the strictness of your chord theory rules, you may let certain rules [consecutive fifths] go to encourage creativity and flow.)
Sample .m4a file available for demonstration purposes: