From my understanding, I will try and show you how to do the first one.
I am going off of a. for this.
Basically what is happening, is to begin with, total = 0 . Using a for loop, you are looping 'i' which is equal to 1 until it is no longer less than or equal to 10. Each time this loops, which will be 10 times I believe, it adds 1 to total. So if this loops 10 times, it will make total equal to 10.
Sorry if this is a crappy explanation. Running on 3 hours of sleep today. Just thought I would try and help since your test is tomorrow and nobody else has answered.