{"id":32125,"date":"2016-02-17T19:17:10","date_gmt":"2016-02-18T01:17:10","guid":{"rendered":"http:\/\/everolivares.wordpress.com\/?p=201"},"modified":"2016-02-17T19:59:16","modified_gmt":"2016-02-18T01:59:16","slug":"quiz-2-15","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101winter2016\/2016\/02\/quiz-2-15\/","title":{"rendered":"QUIZ 2"},"content":{"rendered":"<p>This quiz was also separated\u00a0into two parts&#8230; the first one is able to ask for two different numbers to the user and calculate with a power function, the first number to the power of the second number.<\/p>\n<p>\/\/CODE 1:<\/p>\n<p># include &lt;iostream&gt;<br \/>\n#include &lt;cmath&gt;<br \/>\nusing namespace std;<\/p>\n<p>int main(int argc, char const *argv[]) {<br \/>\nint num1, num2, R;<br \/>\nstd::cout &lt;&lt; &#8220;This program makes the power function between number 1 and number 2.&#8221; &lt;&lt; std::endl;<br \/>\nstd::cout &lt;&lt; &#8220;Please enter number 1&#8221; &lt;&lt; std::endl;<br \/>\nstd::cin &gt;&gt; num1;<br \/>\nstd::cout &lt;&lt; &#8220;Please enter number 2&#8221; &lt;&lt; std::endl;<br \/>\nstd::cin &gt;&gt; num2;<\/p>\n<p>R=pow (num1, num2);<\/p>\n<p>std::cout &lt;&lt; &#8220;The final result is&#8230; &#8221; &lt;&lt;R &lt;&lt; std::endl;<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-206\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/02\/048c4c2562554defd831762e0667e6c6.jpg\" alt=\"Captura de pantalla 2016-02-17 a las 19.14.53\"   \/><\/p>\n<p>This code is able to print a certain\u00a0number of stars with a value given by the user. Using a function called &#8220;stars&#8221; and a loop.<\/p>\n<p>\/\/CODE 2:<\/p>\n<p>#include &lt;iostream&gt;<\/p>\n<p>using namespace std;<\/p>\n<p>void stars(int s) {<br \/>\nint count=0;<br \/>\ndo {<br \/>\nstd::cout &lt;&lt; &#8220;*&#8221; &lt;&lt; std::endl;<br \/>\ncount++;<br \/>\n} while(count!=s);<br \/>\n}<\/p>\n<p>int main(int argc, char const *argv[]) {<br \/>\nint s, count;<\/p>\n<p>std::cout &lt;&lt; &#8220;This program prints the stars you ask for.&#8221; &lt;&lt; std::endl;<br \/>\nstd::cout &lt;&lt; &#8220;Please enter the number of stars you want to print in the console.&#8221; &lt;&lt; std::endl;<br \/>\nstd::cin &gt;&gt; s;<br \/>\nstars(s);<\/p>\n<p>return 0;<br \/>\n}<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-213\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/02\/c692ac904b6842858b00af8bf69042ba.jpg\" alt=\"Captura de pantalla 2016-02-17 a las 19.16.49\"   \/><\/p>\n<p>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/everolivares.wordpress.com\/201\/\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/02\/a00df5ab925d53bf3dbf92b3af74cdfd.jpg\" \/><\/a> <img loading=\"lazy\" decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/02\/8dbe5a60e744b0f196a71f9b11487fab.jpg#038;blog=105236756&#038;%23038;post=201&#038;%23038;subd=everolivares&#038;%23038;ref=&#038;%23038;feed=1\" width=\"1\" height=\"1\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This quiz was also separated\u00a0into two parts&#8230; the first one is able to ask for two different numbers to the user and calculate with a power function, the first number to the power of the second number. \/\/CODE 1: # include &lt;iostream&gt; #include &lt;cmath&gt; using namespace std; int main(int argc, char const *argv[]) { int &hellip; <a href=\"https:\/\/kenscourses.com\/tc101winter2016\/2016\/02\/quiz-2-15\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">QUIZ 2<\/span><\/a><\/p>\n","protected":false},"author":58,"featured_media":32138,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[182,25],"class_list":["post-32125","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-quizes","tag-uncategorized"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/32125","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=32125"}],"version-history":[{"count":2,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/32125\/revisions"}],"predecessor-version":[{"id":32144,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/32125\/revisions\/32144"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/media\/32138"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/media?parent=32125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/categories?post=32125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/tags?post=32125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}