REVIEW… Fin del curso!

¡ HELLO WORLD ! por última vez…

24271690249_2d9b4a68c1_z

Bueno esto es un video sobre el curso en el que hablo sobre como es trabajar con ken Bauer que para mi ha sido un buen profesor, técnicamente no nos enseño a a hacer los trabajos que realizábamos durante el semestre pero nos enseño algo más importante, nos enseño a aprender por nuestra cuenta, a aprender apoyándonos en nuestros amigos, pues los seres humanos necesitamos de los demás, de hecho nuestras clases son multidisciplinarias y se supone que es para que aprendamos a trabajar en equipo, hagamos relaciones para cuando nos graduemos, para que sepamos que no somo unos sabe lo todo, o sea podemos saber mucho pero siempre va a haber alguien que sea mejor que tu en algún tema y tu mejor que otro en x o y cosa, necesitamos aprender a trabajar en equipo.

Ken trabaja de alguna forma como la Academia de Medicina del Itesm, con ABP (Aprendizaje a Base de Problemas) pues el nos da el “tema” y nosotros por nuestra cuenta investigamos y aprendemos, es una forma de no hacernos atenidos.

Link: VIDEO

#QUIZ 07

INSTRUCCIONES

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).

Example. If the input is [2,4,5,6] and [1,2,3,4] the result will be 49 since (2*1)+(4*2)+(5*3)+(6*4) = 49

2016-04-26 (4)

#EXAM PARTIAL 02

1. Write a function called triangles which receives a single parameter (int) which represents the size of a triangle as explained below. 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.

The example below is for size 6:

tes

2016-04-26

2. 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 So, superpower(3,4) would return 81.

long superpower(long a, long b){

}

2016-04-26 (1)

3. NOTE: for full 5 points, use a loop (not recursion). 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.

2016-04-26 (2)

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

2016-04-26 (3)

#QUIZ 05 – Palindrome and Find threes

INSTRUCCIONES

  1. 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).
  2. 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)

CÓDIGO Palindrome2016-04-02 (11)

En este programa se debía pedir una palabra, frase, numero o lo que fuera, para saber si era un palindromo, o sea si se leía igual de derecha a izquierda que de izquierda a derecha .

2016-04-02 (13)

link : Palindrome.cpp

CÓDIGO Find_threes

2016-04-02 (15)

Este programa pide al usuario la cantidad de números que desea ingresar, siguiendo de introducir cada numero que desee, y arroja el resultado de la suma de los números que son divisibles entre 3.

2016-04-02 (16)

link : find_threes.cpp

#QUIZ 04 – Euler

1. The number e is an important mathematical constant that is the base of the natural logarithm. It is approximately equal to 2.71828,[1] and is the limit of (1 + 1/n)n as n approaches infinity, an expression that arises in the study of compound interest. It can also be calculated as the sum of the infinite series.

e =  displaystylesumlimits_{n = 0}^{ infty} dfrac{1}{n!} = 1 + frac{1}{1} + frac{1}{1cdot 2} + frac{1}{1cdot 2cdot 3} + cdots

Source: https://en.wikipedia.org/wiki/E_(mathematical_constant

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).

2016-04-02 (9)2016-04-02 (6)

En este programa cree una función que se encarga de realizar el proceso para el numero de Euler, el programa recibe un valor dado por el usuario, este sera la cantidad de decimales que tendrá la respuesta, tantos decimales como pide el usuario es la exactitud del numero.

Como primer paso pedí el valor al usuario, después se definí la función, agregue el parámetro que debía recibir y lo empece a utilizar, al inicio con un pequeño ciclo que se encarga de detener el proceso del numero de Euler, luego agregue la función factorial de acuerdo al numero que va almacenando un contador y con otro contador se guarda el numero uno sobre su factorial según el numero de intentos, al final solo se imprimen los resultados.