{"id":581,"date":"2023-02-28T15:29:55","date_gmt":"2023-02-28T15:29:55","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/?page_id=581"},"modified":"2023-03-02T15:45:27","modified_gmt":"2023-03-02T15:45:27","slug":"structure-diagrams","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/software-design-and-development\/week-6\/structure-diagrams\/","title":{"rendered":"Structure diagrams"},"content":{"rendered":"\n<p>A structure diagram is useful to show the flow of data in and out of modules. To read a structure diagram you start on the left most of each level and go downwards when possible.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"340\" height=\"599\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153033\/Py52-e1652690851633.png\" alt=\"Example structure diagram\" class=\"wp-image-583\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153033\/Py52-e1652690851633.png 340w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153033\/Py52-e1652690851633-170x300.png 170w\" sizes=\"auto, (max-width: 340px) 100vw, 340px\" \/><figcaption>Example structure diagram<\/figcaption><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<pre class=\"wp-block-code\"><code># Program to find the total of 10 numbers\n\ntotal = 0\nfor counter in range(10):\n    number = int(input(\"Please enter a number between 0 and 100 \"))\n    while True:\n        if number &gt;= 0 and number &lt;= 100:\n            total += number\n            break;\n        else:\n            print(\"Number must be between 0 and 100\")\n            number = int(input(\"Please enter a number between 0 and 100 \"))\n\nprint(\"Total: \" + str(total))\n                 <\/code><\/pre>\n<\/div>\n<\/div>\n\n\n\n<p>So in the above diagram, you complete everything under the &#8220;Repeat 10 times&#8221; branch of the tree before going to the &#8220;Output total&#8221; branch.<\/p>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"701\" height=\"323\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153222\/Py40.png\" alt=\"Process symbol\" class=\"wp-image-587\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153222\/Py40.png 701w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153222\/Py40-300x138.png 300w\" sizes=\"auto, (max-width: 701px) 100vw, 701px\" \/><figcaption>Process symbol<\/figcaption><\/figure><\/div>\n\n\n\n<p>Used to show that a process is needed. This will need code during implementation.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"789\" height=\"353\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153254\/Py49.png\" alt=\"Predefined function symbol\" class=\"wp-image-588\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153254\/Py49.png 789w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153254\/Py49-300x134.png 300w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153254\/Py49-768x344.png 768w\" sizes=\"auto, (max-width: 789px) 100vw, 789px\" \/><figcaption>Predefined function symbol<\/figcaption><\/figure><\/div>\n\n\n\n<p>A function defined in another structure diagram or using a built in system function that does not require additional code.<\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"744\" height=\"353\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153328\/Py50.png\" alt=\"Loop symbol\" class=\"wp-image-589\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153328\/Py50.png 744w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153328\/Py50-300x142.png 300w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><figcaption>Loop symbol<\/figcaption><\/figure><\/div>\n\n\n\n<p>Used to show repetition or iteration. The programmer will need to code the looping structure during implementation.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\">\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"791\" height=\"353\" src=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153359\/Py51.png\" alt=\"Selection symbol\" class=\"wp-image-590\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153359\/Py51.png 791w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153359\/Py51-300x134.png 300w, https:\/\/blogs.glowscotland.org.uk\/es\/public\/software\/uploads\/sites\/4063\/2023\/02\/28153359\/Py51-768x343.png 768w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><figcaption>Selection symbol<\/figcaption><\/figure><\/div>\n\n\n\n<p>Used to show there are different outcomes from this point. The programmer will need to code in conditional statements such as if or else.<\/p>\n<\/div>\n<\/div>\n\n\n\n<p class=\"nextlink\"><a href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/software-design-and-development\/week-6\/user-interface\/\" data-type=\"page\" data-id=\"592\">Next: User interface<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A structure diagram is useful to show the flow of data in and out of modules. To read a structure diagram you start on the left most of each level and go downwards when possible. So in the above diagram, you complete everything under the &#8220;Repeat 10 times&#8221; branch of the tree before going to&hellip; <a class=\"more-link\" href=\"https:\/\/blogs.glowscotland.org.uk\/es\/software\/software-design-and-development\/week-6\/structure-diagrams\/\">Continue reading <span class=\"screen-reader-text\">Structure diagrams<\/span><\/a><\/p>\n","protected":false},"author":5710,"featured_media":0,"parent":24,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-581","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/581","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/users\/5710"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/comments?post=581"}],"version-history":[{"count":7,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/581\/revisions"}],"predecessor-version":[{"id":612,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/581\/revisions\/612"}],"up":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/pages\/24"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/es\/software\/wp-json\/wp\/v2\/media?parent=581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}