{"id":36544,"date":"2017-01-30T07:59:14","date_gmt":"2017-01-30T13:59:14","guid":{"rendered":"https:\/\/kenscourses.com\/tc1014winter2017\/?p=36544"},"modified":"2017-01-30T07:59:14","modified_gmt":"2017-01-30T13:59:14","slug":"wsq04-sum-of-numbers-week-05","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc1014winter2017\/instructor\/wsq04-sum-of-numbers-week-05\/","title":{"rendered":"WSQ04 \u2013 Sum of Numbers (Week 05)"},"content":{"rendered":"<h2>What to Do<\/h2>\n<div id=\"attachment_2930\" class=\"wp-caption alignleft\">\n<p><a href=\"https:\/\/www.flickr.com\/photos\/wisamallami\/2478134485\/\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-2930\" src=\"https:\/\/i1.wp.com\/kenscourses.com\/tc101winter2015\/wp-content\/uploads\/2015\/02\/2478134485_9af16979c1_o.jpg?resize=300%2C201\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" srcset=\"https:\/\/i1.wp.com\/kenscourses.com\/tc101winter2015\/wp-content\/uploads\/2015\/02\/2478134485_9af16979c1_o.jpg?resize=300%2C201 300w, https:\/\/i1.wp.com\/kenscourses.com\/tc101winter2015\/wp-content\/uploads\/2015\/02\/2478134485_9af16979c1_o.jpg?w=800 800w\" alt=\"https:\/\/www.flickr.com\/photos\/wisamallami\/2478134485\/\" width=\"300\" height=\"201\" data-attachment-id=\"2930\" data-permalink=\"http:\/\/kenscourses.com\/tc101winter2015\/course-home-page-for-tc1014\/wsqs-tc1014\/wsq07-sum-of-numbers\/2478134485_9af16979c1_o\/\" data-orig-file=\"https:\/\/i1.wp.com\/kenscourses.com\/tc101winter2015\/wp-content\/uploads\/2015\/02\/2478134485_9af16979c1_o.jpg?fit=800%2C535\" data-orig-size=\"800,535\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;5.6&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;NIKON D40X&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;1208893388&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;52&quot;,&quot;iso&quot;:&quot;200&quot;,&quot;shutter_speed&quot;:&quot;20&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;1&quot;}\" data-image-title=\"Range Sport HST\" data-image-description=\"\" data-medium-file=\"https:\/\/i1.wp.com\/kenscourses.com\/tc101winter2015\/wp-content\/uploads\/2015\/02\/2478134485_9af16979c1_o.jpg?fit=300%2C201\" data-large-file=\"https:\/\/i1.wp.com\/kenscourses.com\/tc101winter2015\/wp-content\/uploads\/2015\/02\/2478134485_9af16979c1_o.jpg?fit=500%2C334\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">https:\/\/www.flickr.com\/photos\/wisamallami\/2478134485\/<\/p>\n<\/div>\n<p>Write a program that asks for a range of integers and then prints the sum of the numbers in that range (inclusive).<\/p>\n<p>You can use a formula to calculate this of course but what we want you to do here is practice using a loop to do repetitive work.<\/p>\n<p>For example, the sum from 6 to 10 would be 0 + 6 + 7 + 8 + 9 + 10.<\/p>\n<p>Notice our sum starts with zero (why?) and then we add each number in the range provided by the user. Just for fun, what is the mathematical formula to do this calculation?<\/p>\n<h2>Example Run<\/h2>\n<p>We will calculate the sum of integers in the range you provide.<br \/>\nPlease give us the lower bound:\u00a0 1<br \/>\nPlease give us the upper bound: 10<br \/>\nThe sum from 1 to 10 (inclusive) is: 55<\/p>\n<h2>Thoughts<\/h2>\n<p>How would you change your program to handle the user giving you the upper and lower bound in the wrong order? Or perhaps some other \u201cuser input error\u201d?<\/p>\n<h2>What to Submit<\/h2>\n<p>As usual, create a blog post explaining what you did, where you found resources (books, videos, web pages, friends) to help you solve this. Remember to put the tag #WSQ04 on your post so our blog hub picks that up.<\/p>\n<p>You should include your code either inline in the blog post (best option) and\/or a link to your actual code on Dropbox\/Google Drive\/GitHub.<\/p>\n<p>You may want to check how to get started on GitHub now, here is a good article to start with: <a title=\"GitHub For Beginners: Don't Get Scared, Get Started\" href=\"http:\/\/readwrite.com\/2013\/09\/30\/understanding-github-a-journey-for-beginners-part-1\">http:\/\/readwrite.com\/2013\/09\/30\/understanding-github-a-journey-for-beginners-part-1<\/a><\/p>\n<p>And of course, leave any questions here as well as asking those questions on Twitter with the hashtag #TC1014 and #WSQ04 so we all see your question posted there.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What to Do https:\/\/www.flickr.com\/photos\/wisamallami\/2478134485\/ Write a program that asks for a range of integers and then prints the sum of the numbers in that range (inclusive). You can use a formula to calculate this of course but what we want you to do here is practice using a loop to do repetitive work. For example, &hellip; <a href=\"https:\/\/kenscourses.com\/tc1014winter2017\/instructor\/wsq04-sum-of-numbers-week-05\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">WSQ04 \u2013 Sum of Numbers (Week 05)<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2930,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,24],"tags":[],"class_list":["post-36544","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-instructor","category-wsq"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc1014winter2017\/wp-json\/wp\/v2\/posts\/36544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kenscourses.com\/tc1014winter2017\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc1014winter2017\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc1014winter2017\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc1014winter2017\/wp-json\/wp\/v2\/comments?post=36544"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc1014winter2017\/wp-json\/wp\/v2\/posts\/36544\/revisions"}],"predecessor-version":[{"id":36545,"href":"https:\/\/kenscourses.com\/tc1014winter2017\/wp-json\/wp\/v2\/posts\/36544\/revisions\/36545"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc1014winter2017\/wp-json\/wp\/v2\/media?parent=36544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc1014winter2017\/wp-json\/wp\/v2\/categories?post=36544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc1014winter2017\/wp-json\/wp\/v2\/tags?post=36544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}