Sum of numbers WSQ07

For this one I actually get a lot of trouble to find out how to make it, because I already know the functions of if and do/while. But for some type of reason I didn’t manage to get it done right. So I ask some of my student partners to if they can explain me how this is suppose to be done. At the end I finally get it right.

Another problem that I faced was the one that it was presented that the sum starter with 0, but I actually need to started in 1 to get it as the example that the teacher give us, that was 1 as the lower and 10 as the upper, and getting 55 as result, but when I started the sum in 0, the program actually give me as result 54, so I change it to 1 so this number was the correct one.

Here are the pictures:

Click to view slideshow.

Here is the code in GitHub:

https://gist.github.com/batmantec/bcec98aea205edcb679c

CC BY-SA 4.0 Sum of numbers WSQ07 by batmantec is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.