{"id":1280,"date":"2016-08-06T05:55:31","date_gmt":"2016-08-06T05:55:31","guid":{"rendered":"http:\/\/www.testingdocs.com\/questions\/?p=1280"},"modified":"2025-08-28T06:04:30","modified_gmt":"2025-08-28T06:04:30","slug":"how-to-create-a-flow-chart-for-sum-of-squares-for-n-integers","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/how-to-create-a-flow-chart-for-sum-of-squares-for-n-integers\/","title":{"rendered":"Flowchart for Sum of Squares for N Integers"},"content":{"rendered":"<h1>Flowchart for Sum of Squares<\/h1>\n<p>Let&#8217;s design a RAPTOR flowchart to compute the sum of squares for n integers. The RAPTOR flowchart enables us to create executable flowcharts.<\/p>\n<h2>Mathematical Notation<\/h2>\n<p>Let&#8217;s first understand mathematical notation. The mathematical notation for the sum of squares up to n numbers is as follows:<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/latex.codecogs.com\/gif.latex?\\fn_phv&amp;space;\\huge&amp;space;Sum&amp;space;of&amp;space;Squares&amp;space;=&amp;space;\\sum_{i=1}^{n}&amp;space;i^{2}\" alt=\"\\fn_phv \\huge Sum of Squares = \\sum_{i=1}^{n} i^{2}\" align=\"absmiddle\" title=\"\"><\/p>\n<p>&nbsp;<\/p>\n<p>or in simple notation<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/latex.codecogs.com\/gif.latex?\\fn_phv&amp;space;\\huge&amp;space;Sum&amp;space;=&amp;space;1^{2}&amp;space;+&amp;space;2^{2}&amp;space;+&amp;space;3^{2}&amp;space;+&amp;space;.&amp;space;.&amp;space;.&amp;space;+&amp;space;n^{2}\" alt=\"\\fn_phv \\huge Sum = 1^{2} + 2^{2} + 3^{2} + . . . + n^{2}\" align=\"absmiddle\" title=\"\"><\/p>\n<p>&nbsp;<\/p>\n<p>Mathematical verification formula:<\/p>\n<p>sum of squares = n(n+1)(2n + 1)\/6<\/p>\n<h2><strong>Steps to build<\/strong><\/h2>\n<p>The general steps to build the RAPTOR flowchart are as follows:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.testingdocs.com\/launch-raptor-on-windows\/\">Launch RAPTOR<\/a> Flowchart software. A blank flowchart with <em>Start<\/em> and <em>End<\/em> symbols will be provided.<\/li>\n<li>Save the flowchart with a <em>.rap<\/em> file extension name.<\/li>\n<li>Add an <em>Assignment<\/em> flowchart symbol for Assignment( left-click once on the symbol and then add it between Start and End.)<\/li>\n<li>Initialize the following variables<\/li>\n<\/ul>\n<p><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 i &lt;- 1<\/em><br \/>\n<em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sum &lt;- 0<\/em><br \/>\n<em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 series &lt;- \u201d \u201d<\/em><\/p>\n<ul>\n<li>Add an <em>Input<\/em> symbol to the flowchart. Double-click to add the \u201cEnter number\u201d prompt and use the variable name <em>N<\/em>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-22030\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Raptor-Flowchart-1.png\" alt=\"Sum of squares Raptor Flowchart 1\" width=\"1918\" height=\"1014\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Raptor-Flowchart-1.png 1918w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Raptor-Flowchart-1-300x159.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Raptor-Flowchart-1-1024x541.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Raptor-Flowchart-1-768x406.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Raptor-Flowchart-1-1536x812.png 1536w\" sizes=\"auto, (max-width: 1918px) 100vw, 1918px\" \/><\/p>\n<h2>Loop Structure<\/h2>\n<ul>\n<li>Add a Loop statement to the flow chart. ( Steps to add the repetition structure <a href=\"https:\/\/www.testingdocs.com\/questions\/how-to-add-repetition-structure-to-the-raptor-flowchart\/\">Add Repetition Symbol to Flowchart\/ )<\/a><\/li>\n<li>Edit the loop expression to<\/li>\n<\/ul>\n<p>i &gt; N<\/p>\n<ul>\n<li>In the loop structure for NO decision, do the following things:<\/li>\n<li>Add Assignment symbols to the flowchart to the flowchart for sum, series and i<\/li>\n<\/ul>\n<p><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sum &lt;- sum + ( i* i )<\/em><br \/>\n<em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 series &lt;- series + \u201d \u201d + ( i*i )<\/em><br \/>\n<em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 i &lt;- i + 1<\/em><\/p>\n<ul>\n<li>Add an <em>Output<\/em> symbol to the flowchart to output series<\/li>\n<\/ul>\n<p><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 series &lt;- series + \u201d \u201d + ( i*i )<\/em> statement is to print the series to the output console window.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22031 size-full\" title=\"Sum of squares RAPTOR Loop\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Loop-RAPTOR.png\" alt=\"Sum of squares Loop\" width=\"1915\" height=\"1011\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Loop-RAPTOR.png 1915w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Loop-RAPTOR-300x158.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Loop-RAPTOR-1024x541.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Loop-RAPTOR-768x405.png 768w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-squares-Loop-RAPTOR-1536x811.png 1536w\" sizes=\"auto, (max-width: 1915px) 100vw, 1915px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Sum of squares<\/h2>\n<p>In the loop structure for the <em>YES<\/em> decision,<br \/>\nAdd an Output symbol to the flowchart to output the sum<\/p>\n<p>Once you are done with a flow chart, we can execute the Raptor flow chart by clicking on Execute to Completion button.<\/p>\n<p>We can verify the input and output of the flowchart. ( Explore Run menu options for more details).<\/p>\n<h2>RAPTOR Flowchart<\/h2>\n<p>RAPTOR Flowchart for the sum of squares for N integers is as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-22033 size-full\" title=\"Sum of Squares Flowchart N Integers\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-Squares-N-Integers-Raptor-Full.png\" alt=\"Sum of Squares Flowchart N Integers\" width=\"428\" height=\"931\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-Squares-N-Integers-Raptor-Full.png 428w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Sum-of-Squares-N-Integers-Raptor-Full-138x300.png 138w\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" \/><\/p>\n<h2>Flowchart Verification<\/h2>\n<p>The following Test case is designed to verify the flowchart output.<\/p>\n<table border=\"1\" cellspacing=\"1\" cellpadding=\"1\">\n<tbody>\n<tr>\n<td><strong>Test Case Scenario<\/strong><\/td>\n<td><strong>Detailed Steps<\/strong><\/td>\n<td><strong>Test Data<\/strong><\/td>\n<td><strong>Expected Result<\/strong><\/td>\n<td><strong>Actual Result<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Find the sum of squares of N integers.<\/td>\n<td>\n<ul>\n<li>Launch Raptor.<\/li>\n<li>Model the flowchart.<\/li>\n<li>Execute the flowchart.<\/li>\n<li>Enter N.<\/li>\n<\/ul>\n<\/td>\n<td>10<\/td>\n<td>385<\/td>\n<td><em>To be filled after executing the flowchart. The actual result should match the expected result.<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Sample Output<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1590\" src=\"http:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Raptor-Flowchart-Run.png\" sizes=\"auto, (max-width: 1363px) 100vw, 1363px\" alt=\"Raptor Flowchart Run\" width=\"1363\" height=\"662\" title=\"\"><\/p>\n<h2><\/h2>\n<p>Series= 1<br \/>\nSeries= 1 4<br \/>\nSeries= 1 4 9<br \/>\nSeries= 1 4 9 16<br \/>\nSeries= 1 4 9 16 25<br \/>\nSeries= 1 4 9 16 25 36<br \/>\nSeries= 1 4 9 16 25 36 49<br \/>\nSeries= 1 4 9 16 25 36 49 64<br \/>\nSeries= 1 4 9 16 25 36 49 64 81<br \/>\nSeries= 1 4 9 16 25 36 49 64 81 100<\/p>\n<p>Sum of squares:385<\/p>\n<p>That&#8217;s it. We have successfully created a flowchart using the RAPTOR software to compute the sum of squares of the first N natural numbers.<\/p>\n<p>&nbsp;<\/p>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" src=\"https:\/\/www.youtube.com\/embed\/CH7m2N585OQ?si=xIvXYyVuqHjZ7929\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>&nbsp;<\/p>\n<h2>Next Question<\/h2>\n<p>The more advanced flowchart is to compute the squares of the user-given numbers stored in an array. We can design complex flowcharts using procedures and functions to accomplish the sub-tasks.<\/p>\n<ul>\n<li><a href=\"https:\/\/www.testingdocs.com\/sum-of-squares-of-given-array-elements\/\">https:\/\/www.testingdocs.com\/sum-of-squares-of-given-array-elements\/<\/a><\/li>\n<\/ul>\n<h2>RAPTOR Tutorial<\/h2>\n<p>Raptor Tutorials on this website can be found at:<\/p>\n<ul>\n<li><a href=\"https:\/\/www.testingdocs.com\/raptor-a-flowchart-tool\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.testingdocs.com\/raptor-a-flowchart-tool\/<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Flowchart for Sum of Squares Let&#8217;s design a RAPTOR flowchart to compute the sum of squares for n integers. The RAPTOR flowchart enables us to create executable flowcharts. Mathematical Notation Let&#8217;s first understand mathematical notation. The mathematical notation for the sum of squares up to n numbers is as follows: &nbsp; &nbsp; or in simple [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[187],"tags":[208],"class_list":["post-1280","post","type-post","status-publish","format-standard","hentry","category-flowchart","tag-mathematics","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=1280"}],"version-history":[{"count":36,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1280\/revisions"}],"predecessor-version":[{"id":27834,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1280\/revisions\/27834"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=1280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=1280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=1280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}