{"id":331,"date":"2022-05-16T16:20:33","date_gmt":"2022-05-16T15:20:33","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/?page_id=331"},"modified":"2022-05-16T16:20:33","modified_gmt":"2022-05-16T15:20:33","slug":"input-validation","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/input-validation\/","title":{"rendered":"Input Validation"},"content":{"rendered":"<p>If incorrect data is entered into any program, then\u00a0inaccurate data will be produced by the program.\u00a0\u200b It is the programmer\u2019s job to restrict users so they can\u00a0only enter valid data into the program.<\/p>\n<p><strong>Input Validation\u00a0<\/strong>is when the computer checks the data\u00a0that has been entered by the user is of the\u00a0<strong>correct type\u00a0<\/strong>and\u00a0<strong>within the correct range<\/strong>.\u00a0\u200b\u00a0 <strong>Input Validation\u00a0<\/strong>uses a combination of a\u00a0<strong>Boolean<\/strong>, a\u00a0<strong>WHILE Loop\u00a0<\/strong>with an\u00a0<strong>IF Statement<\/strong>.\u00a0\u200b<\/p>\n<p><strong>Input Validation\u00a0<\/strong>is used in most programs to control the\u00a0user\u2019s inputs.<\/p>\n<h2 style=\"color: red\"><strong>Python Code Example<\/strong><\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-332\" src=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16162021\/Screenshot-2022-05-16-162009-300x159.png\" alt=\"\" width=\"780\" height=\"413\" srcset=\"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16162021\/Screenshot-2022-05-16-162009-300x159.png 300w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16162021\/Screenshot-2022-05-16-162009-1024x543.png 1024w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16162021\/Screenshot-2022-05-16-162009-768x407.png 768w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16162021\/Screenshot-2022-05-16-162009-624x331.png 624w, https:\/\/blogs.glowscotland.org.uk\/glowblogs\/public\/phsn5computingscience\/uploads\/sites\/10033\/2022\/05\/16162021\/Screenshot-2022-05-16-162009.png 1260w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If incorrect data is entered into any program, then\u00a0inaccurate data will be produced by the program.\u00a0\u200b It is the programmer\u2019s job to restrict users so they can\u00a0only enter valid data into the program. Input Validation\u00a0is when the computer checks the data\u00a0that has been entered by the user is of the\u00a0correct type\u00a0and\u00a0within the correct range.\u00a0\u200b\u00a0 Input [&hellip;]<\/p>\n","protected":false},"author":79984,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-331","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/331","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/users\/79984"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/comments?post=331"}],"version-history":[{"count":1,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/331\/revisions"}],"predecessor-version":[{"id":333,"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/pages\/331\/revisions\/333"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/glowblogs\/phsn5computingscience\/wp-json\/wp\/v2\/media?parent=331"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}