Quiz 07

Here is my blog for the Quiz 07

Create a function called dot_product that receives two lists of numbers (say list1 and
list2). The function returns what is the dot product of the two lists.

For full marks, if the lists are not the same size, then the function should return the
special value of NaN (which represents not a number). Here is the link to my GitHub.

Captura de pantalla 2016-05-05 a las 12.04.04 a.m..png

Word count WSQ12

Here is my blog post for the WSQ 12.

Create a program that asks the user for a word which will be your search word and the name of a file to open and search for that word. Then create a function that will receive two parameters (both string) representing those two data points. This function returns the number of occurrences of that word in that file. Here is the link to my GitHub.

 

Captura de pantalla 2016-05-04 a las 11.14.45 p.m..png

Quiz 05

Here is my blog post to my Quiz 05.

  • 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). Here is the link for my link to GitHub.

Captura de pantalla 2016-05-04 a las 10.29.04 p.m..png

  • 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, you will need an additional parameter to represent the number of numbers in the array. So if the list was [0,4,2,6,9,8,3,12], the function would return 30 (0+6+9+3+12). Here is my code to GitHub.

Captura de pantalla 2016-05-04 a las 10.29.58 p.m..png

Quiz 04

Here is the Blog post for my Quiz number 4.

  1. Create a function called euler_calc with a single parameter precision. The value of precision is used to determine when to stop calculating. Your calculation will stop when the two consecutive values estimating e differ by less than precision (remember to use absolute value when calculating the difference between two values here). Here is the link to my GitHub.

Captura de pantalla 2016-05-04 a las 10.13.20 p.m..png

 

Captura de pantalla 2016-05-04 a las 10.18.10 p.m..png

 

Quiz 03

Here is my blog post for the Quiz 3

  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). Remember that the square of the hypotenuse of a right angle triangle is equal to the sum of the squares of the two other sides. Here is the link to my GitHub.

    Captura de pantalla 2016-05-04 a las 10.05.23 p.m..png

 

  1. Write a function called fibonacci which receives a single parameter“n”(anon-negative integer) and returns the nth number in the fibonacci series which is:
    0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89… Here is the link to my GitHub

Captura de pantalla 2016-05-04 a las 10.06.04 p.m..png

Final Project – Sudoku

My partner in this assignment was Antonio (you can find his blog here Atonio’s blog). At first we didn’t know what to do for the project, after weeks thinking about this, we had the idea of doing a project from past courses, so we looked back to the winter course of 2015 (2015 course), and decided to do a sudoku.

Captura de pantalla 2016-05-04 a las 8.42.49 p.m..png

And we found a video of ken explaining a little bit all this stuff, probably is useful.

Basically , we build our code based blog posts from students in that course . Also it was very helpful this website , to understand some concepts and to create the code. This web page was very useful too.
We did this almost all the time separated, so we could not make a video.

These are the specifications:

  • Create a text based version of a Sudoku.
  • Include all the rules and instructions that apply to the game.

As always here are the links for my GitHub, one is for the code and the other si for the text file.

Working with my partner was great, at the beginning we had lack of communication because we didn’t know what to do, but I felt in confidence with Toño because we are friends and honestly it was easy for me, I think without him I couldn’t done this, we both work separated because we have different classes and different schedule, probably he worked more than me, and was hard to find something good, but at the end we looked for information and watched some videos and thats it, we did it. Is an incredible guy and if you need help with something he will help you.

Exam2 WSQ13

Well kind of late but here are my codes from the partial exam,  I will leave links for my codes in Github, hopefully you’ll find useful.

  1. Write a function called triangles which receives a single parameter (int) which represents the size of a triangle. The function should print a triangle using loops (for or while). The only characters printed here are ‘T’ and the new-line character. The first line is length one, the middle line is length size and the last line is length one. Link to GitHub

Captura de pantalla 2016-04-27 a las 9.54.41 p.m..png

  1. Write a function called superpower that has two parameters of type long and returns a long which is first parameter raised to the power of the second, which is to say it returns a^b. Link to GitHub

    Captura de pantalla 2016-04-27 a las 9.59.14 p.m..png 

  2. Write a function called fibonacci which receives a long “n” and returns a long which is the value of the nth number in the fibonacci series which is: 0,1,1,2,3,5,8,13,21,34,55,89…………
    So, fibonacci(0) would return 0. fibonacci(5) would return 5, fibonacci(8) would return 21.
    Note that the first two fibonacci numbers are 0 and 1.
    All others are the sum of the previous two fibonacci numbers. Link to GitHub

    Captura de pantalla 2016-04-27 a las 10.02.25 p.m..png

  1. Write a function called isPalindrome which receives a string “x” and returns true if the string x is a palindrome, otherwise false. Lint to GitHub

    Captura de pantalla 2016-04-27 a las 10.04.27 p.m..png

Lists WSQ10

Hello everyone! this WSQ is different, well kind of, what to d0:

Create a program that asks the user for 10 numbers. Store those numbers in a list. Show to the user the total, average and standard deviation of those numbers. I found some very useful videos and tutorials:

 

Captura de pantalla 2016-04-07 a las 10.40.28 a.m.

 

Captura de pantalla 2016-04-07 a las 10.37.25 a.m.

Well finally this is the link for my code in GitHub.

 

Factorial calculator WSQ09

Hi everyone! I know that i haven’t blog in a while but I’m back!

What to do?

Create a program that asks the user for a non-negative integer (let’s call that number n) and display for them the value of n! (n factorial). After showing them the answer, ask them if they would like to try another number (with a simple y/n response) and either ask again (for y) or quit the program and wish them a nice day (if they answered n).

Well first of all you need to instal some stuff, the big integer library, at least that was my case, here you have de link for the page BigInteger Library.

Also I recommend you to watch Ken’s video about this, this video is for the last semester, but it might help you.

 

Finally this is my link to my GitHub for my code.

Captura de pantalla 2016-04-07 a las 12.33.01 a.m.