
{"id":15423,"date":"2014-02-09T21:47:45","date_gmt":"2014-02-09T21:47:45","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=15423"},"modified":"2014-02-09T21:47:45","modified_gmt":"2014-02-09T21:47:45","slug":"write-pseudo-code-for-finding-the-mean-of-a-set-of-numbers","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2014\/02\/09\/write-pseudo-code-for-finding-the-mean-of-a-set-of-numbers\/","title":{"rendered":"Write pseudo code for finding the mean of a set of numbers."},"content":{"rendered":"<pre style=\"width:100%;font-family:'Inconsolata', sans-serif;\">\nmean( list_of_numbers )\nlength &lt;-- length of list_of_numbers\nindex &lt;-- 1\nsum &lt;-- 0\nwhile index &lt;= length {\nsum &lt;-- sum + list_of_numbers[index]\nindex &lt;-- index + 1\n}\nreturn sum \/ length\n\nexample input :\n\nmean ( 1 2 3 4 )\nlength &lt;-- 4\nindex  &lt;-- 1\nsum    &lt;-- 0\nlist_of_numbers[1] = 1\nlist_of_numbers[2] = 2\nlist_of_numbers[3] = 3\nlist_of_numbers[4] = 4\n\n[toggle title=&quot;Answer&quot; float=&quot;left&quot; width=&quot;100px&quot; margin=&quot;0 20px 20px 0&quot; status=&quot;closed&quot;] 2.5 [\/toggle]\n\n<\/pre>\n<p>source : SCHAUM\u2019S OUTLINE OF Principles of COMPUTER SCIENCE<\/p>\n","protected":false},"excerpt":{"rendered":"<p>mean( list_of_numbers ) length &lt;&#8211; length of list_of_numbers index &lt;&#8211; 1 sum &lt;&#8211; 0 while index &lt;= length { sum &lt;&#8211; sum + list_of_numbers[index] index &lt;&#8211; index + 1 } return sum \/ length example input : mean ( 1 2 3 4 ) length &lt;&#8211; 4 index &lt;&#8211; 1 sum &lt;&#8211; 0 list_of_numbers[1] = &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2014\/02\/09\/write-pseudo-code-for-finding-the-mean-of-a-set-of-numbers\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Write pseudo code for finding the mean of a set of numbers.&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21],"tags":[1105,1297],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/15423"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=15423"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/15423\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=15423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=15423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=15423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}