{"id":36701,"date":"2016-04-30T20:59:46","date_gmt":"2016-05-01T01:59:46","guid":{"rendered":"http:\/\/everolivares.wordpress.com\/?p=234"},"modified":"2016-04-30T21:11:13","modified_gmt":"2016-05-01T02:11:13","slug":"wsq10-lists-15","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101winter2016\/2016\/04\/wsq10-lists-15\/","title":{"rendered":"#WSQ10-Lists"},"content":{"rendered":"<p>In this WSQ I used arrays of numbers to calculate via functions some mathematical operations given, for example to calculate the total, average and standard deviation of those numbers.<\/p>\n<p>&nbsp;<\/p>\n<p>\/\/CODE<\/p>\n<p>#include &lt;iostream&gt;<br \/>\n#include &lt;cmath&gt;<br \/>\nusing namespace std;<\/p>\n<p>float total(float numbers[], int howMany){<br \/>\nfloat t = 0;<br \/>\nfor (int num=0; num&lt;howMany; num++){<br \/>\nt = t + numbers[num];<br \/>\n}<br \/>\nreturn t;<br \/>\n}<\/p>\n<p>float average(float numbers[],int howMany){<br \/>\nfloat sum=0.0,prom=0.0;<br \/>\nfor (int i=0; i&lt;howMany;i++){<br \/>\nsum+=number[i];<br \/>\n}<br \/>\nprom=sum\/howMany;<br \/>\nreturn prom;<br \/>\n}<\/p>\n<p>float standarddeviation(float numbers[], int howMany){<br \/>\nfloat variation= 0.0, sum=0.0,prom=0.0,deviation=0.0;<br \/>\nfor (int i=0;i&lt;howMany;i++){<br \/>\nsum+=number[i];<br \/>\n}<br \/>\nprom=sum\/total_num;<br \/>\nfor(int i=0;i&lt;howMany;i++){<br \/>\nvariation=variation+pow((number[i]-prom),2);<br \/>\n}<br \/>\ndeviation=sqrt(variation\/howMany);<br \/>\nreturn deviation;<br \/>\n}<\/p>\n<p>int main(int argc, char const *argv[]) {<br \/>\nfloat n, t, a, sd;<\/p>\n<p>float num[10];<br \/>\nstd::cout &lt;&lt; &#8220;Enter 10 numbers Please.&#8221; &lt;&lt; std::endl;<br \/>\nfor (int i=0; i&lt;10; i++){<br \/>\nstd::cin &gt;&gt; n;<br \/>\nnum[i]=n;<br \/>\n}<br \/>\nstd::cout &lt;&lt; &#8221; Total,average,stdev of your numbers are..&#8221;;<br \/>\nt=total(num,10);<br \/>\na=average(num,10);<br \/>\nsd=standarddeviation(num,10);<br \/>\ncout &lt;&lt; t &lt;&lt; std::endl;<br \/>\ncout &lt;&lt; a &lt;&lt; std::endl;<br \/>\ncout &lt;&lt; sd &lt;&lt; std::endl;<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-240\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/04\/45395095b9b79e4f980f0da42fd2ed0a.jpg\" alt=\"Captura de pantalla 2016-04-30 a las 20.58.02\"   \/><img decoding=\"async\" class=\"alignnone size-full wp-image-241\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/04\/021c836e4b0bcfd7de0fe1aa45dbffa7.jpg\" alt=\"Captura de pantalla 2016-04-30 a las 20.58.15\"   \/><\/p>\n<p>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/everolivares.wordpress.com\/234\/\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/04\/fa5b34b8407d361c731227d608a3ff36.jpg\" \/><\/a> <img loading=\"lazy\" decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/04\/b92dd9273b6f5d8c90ddd81815c2b2f7.jpg#038;blog=105236756&#038;%23038;post=234&#038;%23038;subd=everolivares&#038;%23038;ref=&#038;%23038;feed=1\" width=\"1\" height=\"1\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this WSQ I used arrays of numbers to calculate via functions some mathematical operations given, for example to calculate the total, average and standard deviation of those numbers. &nbsp; \/\/CODE #include &lt;iostream&gt; #include &lt;cmath&gt; using namespace std; float total(float numbers[], int howMany){ float t = 0; for (int num=0; num&lt;howMany; num++){ t = t &hellip; <a href=\"https:\/\/kenscourses.com\/tc101winter2016\/2016\/04\/wsq10-lists-15\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">#WSQ10-Lists<\/span><\/a><\/p>\n","protected":false},"author":58,"featured_media":36715,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[41],"class_list":["post-36701","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-wsqs"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/36701","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/comments?post=36701"}],"version-history":[{"count":2,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/36701\/revisions"}],"predecessor-version":[{"id":36721,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/36701\/revisions\/36721"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/media\/36715"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/media?parent=36701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/categories?post=36701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/tags?post=36701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}