Quiz 5

Hey there, I am finally uploading all the Quiz, here I leave you the explanation for each one of the 2 problems of the Quiz 5 and how I solve it.

Part 1:

The part one of the Quiz was a little bit like the #YoSoy196 but it was a little bit different because for flipping the word I look on the internet for a different method because the one I use on the program that look for Lychrel numbers it uses a function to flip number using mod, but this time it was completely different, but in the process of checking it was the same as the #YoSoy196.

Here is what our teacher asked for:

  • Create a function called is_palindrome which receives a string as a parameter and returns true if that string is a palindrome, false otherwise. Remember that a palindrome is a word that is the same forward or backward. For full points your function must ignore case and must work with any character (not just letters). So (“Dad$dad” is a palindrome even though the D is capital and d is lower case).

You can check the hall assignment on this link: http://kenscourses.com/tc101winter2016/2016/03/quiz-05/

Here is the link for the program: https://gist.github.com/batmantec/24c127e27fef36fed4d21c167b529ec5

Here is the pictures of the program running:

Quiz5-1

Part 2:

For the part 2 it was somehow easier for me to get it done, because I didn’t need to look on the internet  for doing it. I just recall some knowledge that I had before it from other programs.

Here is what our teacher asked for:

  • Create a function called find_threes that receives as a parameter a list (or Vector or array for C++ students) of numbers and returns the sum of all numbers in that list that are evenly divisible by 3. Note if using vectors,
    Quiz5-2

    Continue reading “Quiz 5”

#Yo soy 196 #WSQ11

Hey there, finally there is a new program up! Here a video that explains how I did it!

Just kidding! I didn’t do this program on a run, I did it on some minutes of each day! Hope you like the video :3.

For doing it, I actually don’t look for any extra info, just see the video that Ken upload on how to download and put BigInteger and how to use Make, here I leave you the video that Ken put, thanks Ken for it:

Here is some pictures of the program running, at list there is some differences with the program that Ken run, but it’s close:

Sin título

The code, you can check it here:

https://gist.github.com/anonymous/eb59890f7ffa5c1016f4

I know that I don’t upload any video, but I can help you out if you want to, just send me a comment or a message.

Quiz 3

Hey there, here is my quiz 3 results and solution, the instructions where the following ones:

  1. Write a function called distance(x1, y1, x2, y2) which receives four numbers which represent two points in the cartesian plane. The function should return the distance between the two points (x1,y1) and (x2,y2).
  2. Write a function called fibonacci which receives a single parameter “n” (a non-negative integer) and returns the nth number in the fibonacci series.

Here I leave you a link to the quiz: QUIZ3

For the first one, here I leave you all the pictures:

Click to view slideshow.

You can get access to the code in the following link:

https://gist.github.com/batmantec/03e91eda0605eef62746

For the second one, it actually took more research, because I didn’t understand what is the sequence that the Fibonacci use, for it I consult a lot of websites, which I will list here.

http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/Fibonacci/fib.html

https://en.wikipedia.org/wiki/Fibonacci_number

http://platonicrealms.com/encyclopedia/Fibonacci-sequence

At the end, It was really weird how I did manage to make it, but It did gave me the results I was hoping for.

Here I leave you some pictures of the code and the program running:

Click to view slideshow.

The link to the code is here:

https://gist.github.com/batmantec/3ab093f33ee801a6fbdf

Website to master all the topic of C++

The best website to know about C++, at least for my point of view is http://www.cplusplus.com/ here you can search for almost any topic that has to do with C++. You can find from the most essential parts, like how to create a hello world to advance topics on it.

Sometimes reading theory can be annoying, but this website has some examples of code that works, so you can try to implement it onto your program. They are many ways to learn, but for me is seeing how a code is structured and try to understand the logic of the person. This way, I can force my self into knowing different type of logic and the combining those by taking the best part of their logic and structure.

So I use other sources for it, such as youtube, more blogs, and more websites. But this one is the first that I consult for information, because is the most basic way of the code, and it shows you all the parts of the function and ways to implement it.

 

Quiz 2 Part 2

Hey there, its Christian, I finally get the part 2 of quiz running. It was like the first part, but this time it was less values, and the function for the first one is void, so it’s not printed as a number, which in this case we need to print text as the result of it.

Here I leave you pictures of the program:

Click to view slideshow.

Here I leave you link to the code in GitHub:

https://gist.github.com/batmantec/7f37e536c80780c3ca0e

Do – Quiz #2

Hey there, here is how I did my quiz, I use the learned from the On to the function, and I use to base myself on the code that our teacher show us for the function and then I write the code so it can work with the function. I did use do-while, and the program exit when the counter of loops reacher the same amount of the exponential number. Until the loop was running it multiply the ans of the past multiplication for x number that was imputed.

Here I leave you images of the console running and the atom editor:

Click to view slideshow.

Here I leave you the code in github:

https://gist.github.com/batmantec/3dbd1fde9e5bf46899cd

On to the functions WSQ08

In this problem we need to use functions, I use this website to know how to use it: http://www.cplusplus.com/doc/tutorial/functions/

For doing this program, first I read the post on the website listed above and then I try to run the code like 3 times, before I get it right. After all this trouble to know it works I get done. Here I leave the pictures of the program running:

WQS08-

WQS08

The link to the code is here: https://gist.github.com/batmantec/ea5b00180c06988e72ab