{"id":31736,"date":"2016-02-16T08:31:54","date_gmt":"2016-02-16T14:31:54","guid":{"rendered":"http:\/\/canadamike17.wordpress.com\/?p=354"},"modified":"2016-02-16T09:08:26","modified_gmt":"2016-02-16T15:08:26","slug":"quiz3-part2","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101winter2016\/2016\/02\/quiz3-part2\/","title":{"rendered":"Quiz#3 Part#2"},"content":{"rendered":"<p>For this second part of the Quiz, we had to do the Fibonacci sequence, where the user gives a number and the Fibonacci sequence will end on the users number. At first I intended to use a Do, While function where we had two counters, one initialized in 0 and another in 1, and each time the loop repeated the counters will add 1 until it reached the number the user placed in.<\/p>\n<p>But after some trying, it didn&#8217;t worked, so I called Christian to ask him for help, he told me he hadn&#8217;t used any do, or while, and showed me how to do it that way, this time I tryed as he told me and it did work, so I left it how he told me.<\/p>\n<p>My base function was something like this:<\/p>\n<p>int Fib (int cont1, int cont2, int x) {<\/p>\n<p>int x, int cont1==0, int cont2==1<\/p>\n<p>do{<\/p>\n<p>Fib= (cont1+cont2)<\/p>\n<p>while (cont2==x)<\/p>\n<p>&nbsp;<\/p>\n<p>Something like that, but it didn&#8217;t work, so I changed it to this one. Found <a href=\"https:\/\/gist.github.com\/CanadaMike17\/ab2f4d1c9639bd36edab\">HERE<\/a><\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-371\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/02\/5581447d49b3fe192ad41ba032d0b82c.jpg\" alt=\"Screenshot12.2\"   \/><\/p>\n<p>And the process in Cygwin, in which I wanted to know until what number the programm would work without any trouble. I found out that in 50, the numbers came out negative, and by number 300, the computer has not given me an answer yet.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-375\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/02\/e93ef3aa7998188e6ae3d5408b61aad5.jpg\" alt=\"Screenshot12.1.png\"   \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/canadamike17.wordpress.com\/354\/\"><img decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/02\/45cdd8fd67bfe18d2782a311de46604a.jpg\" \/><\/a> <img loading=\"lazy\" decoding=\"async\" alt=\"\" border=\"0\" src=\"http:\/\/kenscourses.com\/tc101winter2016\/wp-content\/uploads\/2016\/02\/e153271804c888f984bcc2323841329a.jpg#038;blog=105223273&#038;%23038;post=354&#038;%23038;subd=canadamike17&#038;%23038;ref=&#038;%23038;feed=1\" width=\"1\" height=\"1\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>For this second part of the Quiz, we had to do the Fibonacci sequence, where the user gives a number and the Fibonacci sequence will end on the users number. At first I intended to use a Do, While function where we had two counters, one initialized in 0 and another in 1, and each &hellip; <a href=\"https:\/\/kenscourses.com\/tc101winter2016\/2016\/02\/quiz3-part2\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Quiz#3 Part#2<\/span><\/a><\/p>\n","protected":false},"author":13,"featured_media":31759,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[63,31,20],"class_list":["post-31736","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-paint","tag-tc101","tag-quiz"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/31736","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\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/comments?post=31736"}],"version-history":[{"count":2,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/31736\/revisions"}],"predecessor-version":[{"id":31765,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/posts\/31736\/revisions\/31765"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/media\/31759"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/media?parent=31736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/categories?post=31736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101winter2016\/wp-json\/wp\/v2\/tags?post=31736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}