HI everybody. I am going to show you how I done the WSQ07. There are different ways to do it, I used “for”.

Here the image, to start:

wsq07

This was kind of easy (If you do not know how to use for, look for my post about it, it is on “Masteries” category).

I think all is easy, but the for, I will focus on it:

First, we have “y” as the variable when we accumulate the progress, and “x” the one that we increase from the lower bound to the upper one. “y” Starts in zero, and we increase it, first by the lower bound, in the second lap, we have “y=y+x”, this means that “y” will be itself plus the “x” value, that increase every lap until it takes the value of the upper bound.

That’s enough, I guess. Any questions, doubts, comments or whatever you want to tell me feel free to do it.

Here is the code: https://github.com/hrglez/TC1017/blob/master/WSQ07%20-%20Sum%20of%20range

CC BY 4.0 WSQ07, Sum of a range by hrglez is licensed under a Creative Commons Attribution 4.0 International License.