{"id":1139,"date":"2016-04-07T09:13:48","date_gmt":"2016-04-07T09:13:48","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/?p=1139"},"modified":"2016-04-07T09:32:17","modified_gmt":"2016-04-07T09:32:17","slug":"national-5-algorithm-specification","status":"publish","type":"post","link":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/2016\/04\/07\/national-5-algorithm-specification\/","title":{"rendered":"National 5 &#8211; Algorithm Specification (Revision)"},"content":{"rendered":"<p><strong>Input validation<\/strong> &#8211; checking that what is entered by the user is acceptable.<\/p>\n<p>The following program checks that age is a positive number.<\/p>\n<pre>1. <strong>SEND<\/strong> \u201cPlease enter age\u201d <strong>TO DISPLAY<\/strong>\r\n3. <strong>RECEIVE<\/strong> age <strong>FROM<\/strong> (INTEGER) <strong>KEYBOARD<\/strong>\r\n4. <strong>WHILE<\/strong> age &lt; 0\u00a0<strong>DO<\/strong>\r\n5. \u00a0 \u00a0 \u00a0 \u00a0 <strong>SEND<\/strong> \u201cre-enter data\u201d <strong>TO<\/strong> <strong>DISPLAY<\/strong>\r\n6.         <strong>RECEIVE<\/strong> age <strong>FROM<\/strong> (INTEGER) <strong>KEYBOARD<\/strong>\r\n7. <strong>END<\/strong> <strong>WHILE\r\n<\/strong><\/pre>\n<p><em>Note that acceptable does not mean accurate, just sensible.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Input validation &#8211; checking that what is entered by the user is acceptable. The following program checks that age is a positive number. 1. SEND \u201cPlease enter age\u201d TO DISPLAY 3. RECEIVE age FROM (INTEGER) KEYBOARD 4. WHILE age &lt; 0\u00a0DO 5. \u00a0 \u00a0 \u00a0 \u00a0 SEND \u201cre-enter data\u201d TO DISPLAY 6. RECEIVE age FROM &hellip;<\/p>\n","protected":false},"author":32,"featured_media":1077,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17935,17013],"tags":[18069],"class_list":["post-1139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-algorithm-specification","category-national-5","tag-input-validation"],"jetpack_featured_media_url":"https:\/\/blogs.glowscotland.org.uk\/nl\/public\/ColtnessHS-ComputingScience\/uploads\/sites\/12638\/2016\/03\/Nat5.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/comments?post=1139"}],"version-history":[{"count":3,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1139\/revisions"}],"predecessor-version":[{"id":1148,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/1139\/revisions\/1148"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/media\/1077"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/media?parent=1139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/categories?post=1139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/tags?post=1139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}