Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":22941,"date":"2015-10-11T15:24:31","date_gmt":"2015-10-11T20:24:31","guid":{"rendered":"http:\/\/myfreakingcrazythoughts.wordpress.com\/?p=120"},"modified":"2015-10-11T15:24:31","modified_gmt":"2015-10-11T20:24:31","slug":"a-factorial-calculator","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2015\/2015\/a-factorial-calculator\/","title":{"rendered":"A Factorial Calculator!"},"content":{"rendered":"

For WSQ#9 we had to write a code who calculates the Factorial number of “n”.<\/p>\n

For the ones who doesn’t know what a factorial number is (including me, 20 minutes ago) a factorial number means a function which multiplies a serial of descending natural numbers.<\/p>\n

For example:<\/p>\n

4!<\/strong> = 4x3x2x1 = 24<\/strong><\/p>\n

So the rule is:<\/p>\n

n! = n \u00d7 (n\u22121)!<\/strong><\/p>\n

And to do that in a C++ program, we have to develop a bit more complex process than that, so it would look like this:<\/p>\n

\n
\/* Source code to find factorial of a number. *\/<\/span>\n#include <iostream><\/span>\nusing<\/span> namespace<\/span> std;<\/span>\nint<\/span> main<\/span>()<\/span>\n{<\/span>\n  int<\/span> x<\/span> ,<\/span> factorial=<\/span>1<\/span>;<\/span>\n\n    cout<\/span> <<<\/span> \"Please enter a non-negative number:  \"<\/span> <<<\/span> endl;<\/span>\n    cin<\/span> >><\/span> x;<\/span>\n\n    for<\/span>(<\/span>int<\/span> a=<\/span>1<\/span>;<\/span> a<=x;<\/span> a++)<\/span>\n    {<\/span>\n        factorial=factorial*a;<\/span>\n    }<\/span>\n\ncout<\/span> <<<\/span> \"The factorial of your number is \"<\/span> <<<\/span> factorial<\/span> <<<\/span> endl;<\/span>\ncout<\/span> <<<\/span> \"Would you like to play again?   \"<\/span>;<\/span>\nstring<\/span> answer;<\/span>\ncin<\/span> >><\/span> answer;<\/span>\n\ndo<\/span>\n{<\/span>\n    int<\/span> x<\/span> ,<\/span> factorial=<\/span>1<\/span>;<\/span>\n\n    cout<\/span> <<<\/span> \"Please enter a non-negative number:  \"<\/span> <<<\/span> endl;<\/span>\n    cin<\/span> >><\/span> x;<\/span>\n\n    for<\/span>(<\/span>int<\/span> a=<\/span>1<\/span>;a<=x;a++)<\/span>\n    {<\/span>\n        factorial=factorial*a;<\/span>\n    }<\/span>\n\n    cout<\/span> <<<\/span> \"The factorial of your number is \"<\/span> <<<\/span> factorial<\/span> <<<\/span> endl;<\/span>\n    cout<\/span> <<<\/span> \"Would you like to play again  ? \"<\/span>;<\/span>\n    cin<\/span> >><\/span> answer;<\/span>\n\n}<\/span>while<\/span> (answer<\/span> ==<\/span>\"yes\"<\/span>);<\/span>\n\nif<\/span> (answer==<\/span> \"no\"<\/span>)<\/span>\n{<\/span>\n  cout<\/span> <<<\/span> \"AS YOU WISH MASTER, MAY THE FORCE BE WITH YOU! \"<\/span> <<<\/span> endl;<\/span>\n}<\/span>\n\nreturn<\/span> 0<\/span>;<\/span>\n}<\/span>\n<\/pre>\n<\/div>\n

And also, as you can see in the code, at the end the program will ask the User if he would like to play again or quit, and if he quits a message will show up on his screen.<\/p>\n

So the program will basically look like this!<\/p>\n

\"FactorialCalculation<\/a><\/p>\n

As always I will leave my codes<\/a> on the GitHub account and if you have any doubts feel completely free to ask me on the comments section!<\/p>\n

Have a nice day, and remember to keep practicing<\/p>\n

-The Admin.<\/p>\n

\"\"<\/a> \"\"<\/p>\n","protected":false},"excerpt":{"rendered":"

For WSQ#9 we had to write a code who calculates the Factorial number of “n”. For the ones who doesn’t know what a factorial number is (including me, 20 minutes ago) a factorial number means a function which multiplies a… Continue Reading →<\/a>\"\"<\/p>\n","protected":false},"author":259,"featured_media":22939,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[582,206,334,734,152,617,614],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/22941"}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/users\/259"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/comments?post=22941"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/22941\/revisions"}],"predecessor-version":[{"id":22942,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/22941\/revisions\/22942"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media\/22939"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=22941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=22941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=22941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}