WAQ14 Scilab

Scilab es un herramienta muy poderosa y ha tenido tanta fama debido a que es gratis. Es un programa de procesamiento de datos matemáticos con mucho potencial. Este requiere de programación para poder utilizarlo. En lo personal lo he utilizado muy poco, pero hablando con mi maestra de matemáticas  nos comento que aunque tiene mucho poder y que es gratis, Scilab se ve opacado por softwares como R y Matlab, siendo R gratuito y Matlab de paga. Los tres requieren de una programacion muy parecida. Asi que vale la pena aprender a programar en cualquiera de estos 3 softwares ya que va a ser algo que vamos a necesitar durante toda nuestra carrera y vida porfecional como ingenieros.

#QUIZ06 Euclidian Algorithm

One week later is way better than never, instructions of the Quiz are here.

Summing the instructions we should create a code which receives two numbers or parameters from the user, then in a function print the biggest denominator that divides both numbers.

10330240_1045265532201362_6669094908167145769_n.jpg Clic on the amazed monkey for more information about the Euclidian Algorithm

                           [CODE on cygwin]

Once you understand the logic of the problem, its pretty easy to solve, you will only need a 4 lines function + the main part of the code.

jenfjejeAs you can see you only need to link two values to the function whose are the first and second value that the user typed.

Sin knceejdf.png

Here is the proccess using the two numbers of the Ken example´s page. 270 & 192.

Its was a good challenge, to improve our knowledge, I didn´t know what a Euclidian Algorithm was so it was interesting, and I think useful.

As Always, Random Stuff at the end[+Great song]

Yall love science(or Im just guessing) and for the same reason you´ll love this video

And a lovely song, of Alt J, Enjoy! And have a great holiday!

#QUIZ05 Palindrome & 3Divisibles

Sorry for posting Quiz05 until now but i totally had my mind in the Lychrel numbers(now on my blog if you want to check it) .

tumblr_o3nm7uOO7v1tiyj7vo1_500.jpg

Quiz05, first thing to do is something related to the Lychrel, check if a word(string) its a palindrome or if its now, creating a bool function for it and printing the result.

Some new stuff on the code, like using .size and .rend, not to hard to understand them but here´s more information. There´re different ways to get the inverse of a string, the one I´ve done in the code is the easier to do in my opinion. (If you find an easier one let me know)

Palindrome:[CODE]

palin.png

As you can see we´re working with a boolean expression ´cause we only need to verify if its a palindrome or its not. Instead of doing it as a bool try using int and give a 1 if ifs a palindrome or 0 if its not, both methods work perfectly.  Quick doubt-solving page for you who don´t know what´s r.begin and .rend.

And here the main part of the code:

main.png

Just make a condition for the boolean expression and thats all.

3Divisibles:[CODE]

In this case, you have to create an array which contains a whole bunch of numbers that the user types and add only the ones which are divisibles by 3. Example: Range(5,3,10,6,2) from this range it only add the 3 and the 6. So it prints the total of the addition as a 9.

In my case, before giving the array a value, I ask the user for the numbers of values he will type, and thats the capacity of the array.

3div.png

And just like the #WSQ10 you create a for loop to ask for all the values.

total

Easy to understand, I

Sin título.png

Continue reading “#QUIZ05 Palindrome & 3Divisibles”

#WSQ11 #NadieQuiereSer196

One freaking week breaking my head and having brainstorm ideas to figure out how to write this satanic code(Not even Satan would create something like this) thank God Aguayo for gave me the patience to not freak out and finally finish the code.

As usual here´s the code(yeah i know you´re just coming to my blog for it) click on the random image to go to GitHub[The code won´t work until you install the BigInteger and do all the proccess Ken explains in this VIDEO] and don´t forget to thank Aguayo for his greatness

12800132_10208894747391030_7422022885247348938_n.jpg

I´ve also made a video explaining the code working and its structure so there isn´t any screenshot this time, here it is:

Like always, here some random Tumblr picture again

 

 

·Lists· #WSQ10

Bueno este blog lo escribiré en español debido a que tengo demasiada flojera para inspirarme en inglés…

En este programa tenía que crear una lista de 10 números y al final mostrar la suma de éstos, su desviación estándar y el promedio de los números. Para este programa es muy recomendable el uso de funciones.

Creé una función llamada getTotal que era la encargada de sumar todos los números. Después creé otra función llamada getAverage que era la encargada de obtener el promedio de los números, pero dentro de ésta llamé a la función getTotal, en la que ya tenía el total de la suma y solo tenía que dividirlo entre los 10 números.

Por último, para la desviación estándar tuve que buscar la fórmula y ésta usaba mi función de promedio. Tuve que pedir un poco de ayuda de mi buen amigo Darío, puedes visitar su blog aquí.

Captura de pantalla 2016-03-08 a las 12.08.01.png

También puedes encontrar el código de este programa en GitHub. Click aquí.

5nczoumgibjzo

I got it “Yo soy 196” WSQ11 :)))

Que tal, después de dos días sin dormir conseguí terminar la tarea. Enserio q me costo mucho explicarlo pero lo hice lo mas claro posible que pude. Espero les ayude. Esta es las versión 1.0, aunque funciona como me la pidieron. Se agradecen sus comentarios 🙂

Les recomiendo usar audífonos para que escuchen mejor.

El vídeo esta muy largo pero aquí les dejo el código completo (no se olviden de citar si lo quieren utilizar 😉

#include <iostream>
using namespace std;

int reverse(long num){
long numRev=0;
long sum;
int cont=-1;
do{
sum=num;
numRev=0;
while (num!=0){
numRev= numRev*10+(num%10);
num=num/10;

}
cont++;
num=numRev+sum;
}
while(sum!=numRev && cont!=30);

return cont;

}
int main (){
int uBound, lBound, palandrome, vPalandrome=0, vNonLycherels=0, vLycherels=0;

cout << “Give The lower bound of the sequencen”;
cin >> lBound;
cout << “Give The upper bound of the sequencen”;
cin >> uBound;

for(int z=lBound; z<uBound+1; z++){

reverse(z);
palandrome=reverse(z);
if(palandrome==0){
vPalandrome++;
}
else if (palandrome<30){
vNonLycherels++;
}
else if (palandrome==30){
vLycherels++;
}

}
cout <<“Palandrome”<< vPalandrome <<endl;
cout <<“Non-Lycherels”<< vNonLycherels <<endl;
cout <<“Lycherels”<< vLycherels <<endl;
return 0;
}