·Sum of numbers· #WSQ07

For this program I had to use an if and a loop. The use of “if” was in order to make sure the user would not screw it up with the order of the numbers. At first I couldn’t figure it out the main logic of the program but then I had a moment of inspiration haha and here is the result.

Here is a screenshot of my code. Also you can check it out on GitHub. Link.

Captura de pantalla 2016-02-02 a las 12.38.34

It is important to keep in mind that the user won’t do exactly what you want, so you should always be prepared for the unexpected things.

And here you can see a video of my code working on ScreenCast…. Link

Captura de pantalla 2016-02-02 a las 22.57.19.png

I will be publishing all the WSQ’s soon and I hope it would help others. 😀

Alex H.

24294566811_7004231734_k
Another Sunrise over the Alps by Rogg4n Link on Flickr: https://www.flickr.com/photos/128294308@N05/24294566811/in/explore-2016-01-14/

 

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