{"id":38367,"date":"2016-05-12T00:38:20","date_gmt":"2016-05-12T05:38:20","guid":{"rendered":"http:\/\/diegodamy.wordpress.com\/?p=308"},"modified":"2016-05-12T02:12:11","modified_gmt":"2016-05-12T07:12:11","slug":"wsq13-exam-corrections","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101winter2016\/2016\/05\/wsq13-exam-corrections\/","title":{"rendered":"WSQ13: Exam corrections"},"content":{"rendered":"<p>#TC1017 #WSQ13<\/p>\n<p>Q1:<\/p>\n<p>For this first question we had to print out a kind of rotated pyramid, which I must say I found somewhat complicated because of the nested ifs. All important notes can be found in the source code:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-316\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/05\/6cdb09db1a8f323a5a301dc8dadfb82e.jpg\" alt=\"Captura\"   \/><\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p>Q2:<\/p>\n<p>The superpower one. We had already done this as a quiz, but I didn\u00b4t realize my old code wasn\u00b4t really working so it took me a while to realize what I was doing wrong. It turned out I had to multiply the result by the base, and I was doing some weird additions. But now it works perfectely.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-326\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/05\/d17e6178f44945d81f35120375612180.jpg\" alt=\"Captura.PNG\"   \/><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p>Q3:<\/p>\n<p>The fibonacci series was also already done before, it is quite simple.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-331\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/05\/a89c8da59107f313761831d69c83fe40.jpg\" alt=\"Captura.PNG\"   \/><\/p>\n<hr \/>\n<p>Q4:<\/p>\n<p>This last problem I could not complete, but here is my source code:<\/p>\n<p>#include &lt;iostream&gt;<br \/>\n#include &lt;string&gt;<\/p>\n<p>using namespace std;<\/p>\n<p>int FindPali(string word){<br \/>\nint i, j;<br \/>\nint size = word.size();<\/p>\n<p>\/*This cycle should compare all indices to their opposites to chech for symmetry and decide wheter it is a palindrome or not, however it is not doing anything it seems.*\/<br \/>\nfor (i=0; i&lt;size; i++){<br \/>\n} cout &lt;&lt; word[i];<br \/>\nfor (j=size; j&gt;0; j&#8211;){<br \/>\n} cout &lt;&lt; word[j];<br \/>\nif (word[i] == word[j]){<br \/>\nreturn 1;<br \/>\n}<\/p>\n<p>}<\/p>\n<p>int main(){<br \/>\nstring word;<br \/>\ncout &lt;&lt; &#8220;Please enter the word:&#8221; &lt;&lt; endl;<br \/>\ngetline (cin, word);<\/p>\n<p>if (FindPali(word)==1){<br \/>\ncout &lt;&lt; &#8220;Palindrome!&#8221; &lt;&lt; endl;<br \/>\n} else {<br \/>\ncout &lt;&lt; &#8220;Not a palindrome.&#8221;&lt;&lt; endl;<br \/>\n}<\/p>\n<p>}<\/p>\n<p>GitHub link including all questions:\u00a0https:\/\/github.com\/diegodamy\/Exam2-Q1<\/p>\n<p>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/diegodamy.wordpress.com\/308\/\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/05\/981bdc7c9353e63fb5ba2f4e5941afb5.jpg\" \/><\/a> <img loading=\"lazy\" decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/05\/72243067e4e5a3be3d123ec8d0063a76.jpg#038;blog=105336245&#038;%23038;post=308&#038;%23038;subd=diegodamy&#038;%23038;ref=&#038;%23038;feed=1\" width=\"1\" height=\"1\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>#TC1017 #WSQ13 Q1: For this first question we had to print out a kind of rotated pyramid, which I must say I found somewhat complicated because of the nested ifs. All important notes can be found in the source code: &nbsp; &nbsp; Q2: The superpower one. We had already done this as a quiz, but &hellip; <a href=\"https:\/\/kenscourses.com\/tc101winter2016\/2016\/05\/wsq13-exam-corrections\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">WSQ13: Exam corrections<\/span><\/a><\/p>\n","protected":false},"author":20,"featured_media":38381,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[32,44],"class_list":["post-38367","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-tc1017","tag-wsq13"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/38367","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\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/comments?post=38367"}],"version-history":[{"count":2,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/38367\/revisions"}],"predecessor-version":[{"id":38389,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/38367\/revisions\/38389"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/media\/38381"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/media?parent=38367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/categories?post=38367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/tags?post=38367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}