Quiz III

Brace yourselves, the partial is coming. Meanwhile, we have to answer a third quiz.

quiz3instructions.png

At the first point we had to find the distance between two points. If you represent this as an a triangle, it would be like Image 1 where A is (x1,y1) and B is (x2,y2), so we had to find the value of h.

2000px-trigonometry_triangle-svg
Image 1

At first I tried to find the distance between each axis. This means what is the difference of x1 and x2 and what is the difference between y1 and y2. This got complicated to me since distance is absolute, yet the answer was given as negative in some occasions. This got fixed when I used a conditional to multiply it by -1 to make it positive.

 

Then I got to the point to find h. I used the basic pythagoras theorem (C^2=A^2+B^2)  and then use the squareroot to get the answer. Ken teached me that there was a simplier way: use the distance command. Yet, It have me errors when running so I kept it at my mode since it works. Of course this does not means I am not going to fix what Ken helped me with. The code and how it runs looks like this:

pythagoras

For the second part of the quiz I had  a big time learning what to do. Firstly because I did not even know what the Fibonacci Numbers are. After I knew what they are, I searched all over the internet to see how to do it. Technobeans showed me 5 different methods of how to do it; however, Naren’s method in the comments helped me better.

fabonacci

Remember to keep checking my GitHub to see the code clearer.

Time for you to meet Bloc Party’s “Helicopter”. I got into this band because of

helicopter

Modern Love” at the end of the Season one of How I Met Your Mother, I will reference this show several times for your information, when Marshall Eriksen and Ted Mosby met a different faith at love.  When I heard this song, I remember hearing it somewhere.It was in Guitar Hero III, sorry.

 

helicopter

CC BY-SA 4.0 Quiz III by rhcpalmarichie is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.