{"id":5837,"date":"2017-01-03T07:33:58","date_gmt":"2017-01-03T07:33:58","guid":{"rendered":"https:\/\/www.testingdocs.com\/questions\/?p=5837"},"modified":"2024-12-14T04:16:42","modified_gmt":"2024-12-14T04:16:42","slug":"how-to-read-values-into-an-array-using-raptor-flowchart","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/how-to-read-values-into-an-array-using-raptor-flowchart\/","title":{"rendered":"How to read values into an array using RAPTOR"},"content":{"rendered":"<h1>How to read values into an array using RAPTOR<\/h1>\n<p>In this post, we will learn how to read values into an array using a RAPTOR flowchart. We will prompt the user to enter marks for a student in five subjects. For this example, we will take a single-dimensional array variable called marks. marks is an array variable that represents the marks of a student called Alice in five different subjects: English, Mathematics, Physics, Chemistry, and Biology.<\/p>\n<h3>Flowchart<\/h3>\n<p>The flowchart would prompt the user to enter 5 subject marks. the numbers are stored in an array variable marks. The numbers would be stored using the index variable. The index is assigned to 1 and controlled with a loop. The loop would quit once the index is greater than 5.<\/p>\n<p>marks[1]<\/p>\n<p>marks[2]<\/p>\n<p>marks[3]<\/p>\n<p>marks[4]<\/p>\n<p>marks[5]<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5840 size-full\" title=\"Read values into an array \" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Read-values-into-an-array-RAPTOR-Flowchart.png\" alt=\"Read values into an array RAPTOR\" width=\"1387\" height=\"922\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Read-values-into-an-array-RAPTOR-Flowchart.png 1387w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Read-values-into-an-array-RAPTOR-Flowchart-300x199.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Read-values-into-an-array-RAPTOR-Flowchart-1024x681.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Read-values-into-an-array-RAPTOR-Flowchart-768x511.png 768w\" sizes=\"auto, (max-width: 1387px) 100vw, 1387px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>Loop condition<\/h3>\n<p>The loop is controlled using the loop condition. If the condition is No, the loop is evaluated, and if it is true, it is executed. The index is incremented inside a loop.<\/p>\n<p>index &lt;- index + 1<\/p>\n<p>The user entered values are stored using the array variable and the index inside square brackets.<\/p>\n<p>marks[index]<\/p>\n<h3>Pseudocode<\/h3>\n<pre>ReadArray() \r\n      DECLARE index\r\n      DECLARE marks()\r\n\r\n      index = 1\r\n      DO UNTIL  index &gt; 5\r\n         PROMPT \"Enter marks for Alice\"\r\n         INPUT  marks(index)\r\n         index = index + 1\r\n      LOOP\r\nEND\r\n<\/pre>\n<h3>Print the array<\/h3>\n<p>To print the values in the array we need to use a loop. Instead of reading the values we use the output statement to print the values of the array.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5859\" src=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/output-an-array-elements.png\" alt=\"output an array elements\" width=\"1304\" height=\"913\" title=\"\" srcset=\"https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/output-an-array-elements.png 1304w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/output-an-array-elements-300x210.png 300w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/output-an-array-elements-1024x717.png 1024w, https:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/output-an-array-elements-768x538.png 768w\" sizes=\"auto, (max-width: 1304px) 100vw, 1304px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to read values into an array using RAPTOR In this post, we will learn how to read values into an array using a RAPTOR flowchart. We will prompt the user to enter marks for a student in five subjects. For this example, we will take a single-dimensional array variable called marks. marks is an [&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-5837","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\/5837","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=5837"}],"version-history":[{"count":25,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/5837\/revisions"}],"predecessor-version":[{"id":26400,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/5837\/revisions\/26400"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=5837"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=5837"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=5837"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}