We can't run this code because it isn't in the form of an MCVE.

What have you tried? What exactly are you confused about? We aren't just going to do your homework for you.