#WSQ12

#include “BigIntegerLibrary.hh”
#include <iostream>
#include <string>
using namespace std;

BigInteger lychrel (BigInteger x){

string z = bigIntegerToString(x);
lychrel(z.begin(), z.end());
BigInteger lychrel = stringToBigInteger(z);
return lychrel;
}

int main() {
int inferior,superior, p, k, number, a=0;
int f=0, n=0;
BigInteger y, c=0, suma=0;

cout << “Dame el limite inferior”;
cin>>inferior;

cout<< “Dame el limite superior”;
cin>>superior;

for(c=inferior; c<=superior; c++){
for(BigInteger m=count; m<=count;m++){

y= lychrel(m); suma=y+c;}

if(c==y) {
n=n+1;
} else {
int times= 0;

BigInteger numero = c;
y=lychrel(numero);

while(times<30 && numero!=y){

number = numero+y;
y = lychrel(numero);
times = times+1;
}
if(times < 30){
a = a+1;
} else {
cout << “Lychrel found ” <<c<< endl;
f = f+1;
}
}
}

cout <<“The palindrom is: ” << n <<endl;
cout<<“Non lychrel become palindrom in one interacion: “<<a<<endl;
cout<<“The lychrel is: “<<f<<endl;

return 0;
}

Proyecto final

Programación de una Aplicación para Android con app-inventor de: http://ai2.appinventor.mit.edu/

La aplicación permite enviar datos a un micro controlador  MC9S08QG8 de Freescale, desde una base datos en un archivo .txt, los archivos son leidos desde la app y convertidos en una array, el micro se conecta por bluetooth al celular. El micro los recibe y los expulsa como bits a un DAG (convertidor digital a analógico) para simular la señal de un ECG. Las base de datos son señales de ECG con diferentes patologías.

Interface:

13148274_10209327606007537_1129326594_o.png

Barcode link para descargar app:

Diseño de la interface:

Captura de pantalla 2016-05-12 16.34.09.png

Pseudo-código

Captura de pantalla 2016-05-12 16.38.40.png

Captura de pantalla 2016-05-12 16.38.54.png

Archivo .aia para editar:

https://www.dropbox.com/s/hix0gve8swzre5x/ASyS_2%20%282%29.aia?dl=0

Quiz

Quiz 1

#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
float r, h, v;
cout<<“Dame el radio: “;
cin>>r;
cout<<“Dame la altura: “;
cin>>h;
v=3.1416*r*r*h;
cout<<“el resultado es “<<v;
getch();
return 0;
}

#include <iostream>
#include <conio.h>
#include <cstring>
using namespace std;
int main()
{
int resul2, num1, num2,resul3;
float resul1;
cout<<“Dame un numero: “;
cin>>num1;
cout<<“Dame otro numero: “;
cin>>num2;
resul3=num1*num2;
resul2=(int)num1/num2;
resul1=num1/num2;
cout <<“nEl resultado de multiplicarlos es “<<resul3;
cout <<“nTu resultado de una division entera es “<<resul2;
cout <<“nEl resultado de una division con decimales es “<<resul1;
}

#include <iostream>
#include <conio.h>
#include <cstring>
using namespace std;
int main()
{
int resul2, resul1, resul3, resul4;
float num1, num2;
cout<<“Dame un numero: “;
cin>>num1;
cout<<“Dame otro numero: “;
cin>>num2;
resul1=num1*num2;
resul2=num1/num2;
resul3=num1+num2;
resul4=num1-num2;
cout <<“nEl resultado de multiplicarlos es “<<resul1;
cout <<“nEl resultado de una division es “<<resul2;
cout <<“nEl resultado de una suma es “<<resul3;
cout <<“nEl resultado de resta es “<<resul4;
}

Quiz 2

#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int num, i;
i=1;
cout<<“nCuantos estrellas quieres: “;
cin>>num;
do
{
i++;
cout <<“*”;
} while(i<=num);
getchar();
return 0;
}

#include<iostream>
#include<math.h>
long superpower(long a,long b)
{
using namespace std;
long res;
res=pow(a,b);
cout << “El resultado de “<<a<<“^”<<b<<“=”<<res<<endl;
}
int main(){
using namespace std;
long base,exp;
cout << “Dame la base del numero a elevar”<<endl;
cin>>base;
cout << “Dame el exponente del numero a elevar”<<endl;
cin>>exp;
superpower(base,exp);
system(“pause”);
return 0;
}

Quiz 3

#include <iostream>
#include <cmath>
#include <math.h>
#include <conio.h>
#include <stdio.h>
using namespace std;
int main()
{
int x1,x2,y1,y2;
double x,y,result;
cout <<“nDame la cooordenada x de el eje x del primer punto”<<endl;
cin>>x1;
cout <<“nDame la cooordenada x de el eje y del primer punto”<<endl;
cin>>y1;
cout

Continue reading “Quiz”

WSQ13

P2v2

q1_

Gráfico1.JPG

código:

#include<iostream>

int main()
{
using namespace std;
int num,i,x;
cout << “Dame el tamano del triangulo”<<endl;
cin>>num;
for(i=1;i<=num;i++)
{
for(x=1;x<i+1;x++)
{
cout<<“T”;
}
cout<<endl;
}
for(i=num;i>=1;i=i-1)
{
for(x=i;x>=1;x=x-1)
{
cout<<“T”;
}
cout<<endl;
}
return 0;
}

q2_

Gráfico1.JPG

código:

#include<iostream>
#include<math.h>
long superpower(long a,long b)
{
using namespace std;
long res;
res=pow(a,b);
cout << “El resultado de “<<a<<“^”<<b<<“=”<<res<<endl;
}
int main(){
using namespace std;
long base,exp;
cout << “Dame la base del numero a elevar”<<endl;
cin>>base;
cout << “Dame el exponente del numero a elevar”<<endl;
cin>>exp;
superpower(base,exp);
system(“pause”);
return 0;
}

q3

Gráfico1.JPG

#include<iostream>
#include<math.h>
#include<cstdlib>
long fibonacci (long n){
using namespace std;
long a=1,b=0,res,i;
if(n==2)
{
cout << “El resultado de nivel es 1″<<endl;
}
else
{
if(n==1)
{
cout << “El resultado de nivel es 0″<<endl;
}
else
{
for(i=1;i!=n-1;i++)
{
res=a+b;
b=a;
a=res;
}
cout << “El resultado de nivel es “<<res<<endl;
}
}
}
int main(){
using namespace std;
long num;
cout << “Cual es el nivel al llegar el fibonacci”<<endl;
cin>>num;
fibonacci(num);
system(“pause”);
return 0;
}

WSQ10

Gráfico1.JPG

mi código:

#include <iostream>
#include <conio.h>
#include <math.h>
#include <cmath>
using namespace std;
int main()
{
int cont;
float suma, promedio, desvest, sumapot;
float numeros[10];
suma=0;
sumapot=0;
for(cont=1;cont<=10;cont++)
{
cout<<“Dame el numero [“<<cont<<“]: “<<endl;
cin>>numeros[cont];
suma=suma+numeros[cont];
sumapot=sumapot+pow(numeros[cont],2);
}
promedio=suma/10;
desvest=sqrt(1/9*(sumapot-10*pow(promedio,2)));
cout<<“La suma de los numeros es: “<<suma<<“, el promedio es: “<<promedio<<“, la desviacion estandar es: “<<desvest;
return 0;
}

Course Review

The moment you’ve all been waiting for people, we finish the course. But I can’t leave without giving you a little opinion by myself about this course.

#AbolishGrades – #FlippedLearning are two types of innovative education Ken is implementing in this new “TEC21” system, making you to learn by your own at anytime you want without having any type of due dates.

I fully recommend this course for new people who hasn’t see anything about programming, plus, if you get troubled, everyone can help you, so does Ken too.

Before I forget it, I’ve uploaded all my codes to GitHub, here.

See you next time people:)