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;
}

Class Review

Hello everyone that normally follows my blogs, I know that I took longer than expected this time. I have just been bad at managing my time lately, I have to work more on that. Well in this blog I’m gonna be talking about ken’s course and this new method of LEARNING not teaching. Let me just start off by saying that I loved it and I wish more everybody else was doing it too. Of course not exactly the same because every course needs it’s own special way. I mean programming at this level is something that you can pretty much do by yourself but physics, math and chemistry maybe is so easy. For example the video below is a perfect demonstration on what ken’s doing with us in his class. It is not exactly the same but it is very very similar. I guess the big difference would be that he does give us any specific video to watch, he just expects us to learn at home but during class he is always there to help, so that part is the same.

I was skeptical about this course at first I even went to see ken at his office to tell him that I was a bit worried about how things were gonna go. He told it would be fine and I guess I trusted him. Even though ken didn’t really lecture us on anything rather than asked us to make new programs and to find out how to do them on our own, I learned so much about programming and social networking. I used to hate asking anybody, other than the teacher, for help. Now I see that it is even better to learn with your classmates instead of by yourself. Now before I talk about the things

Continue reading “Class Review”

#Wsq14 Scilab

Hola a todos el ultimo WSQ14 consite en aprender un poco sobre scilab, veamos que es esto y para que sirve

Scilab es un software para análisis numérico, con un lenguaje de programación de alto nivel para cálculo científico. Es desarrollado por Scilab Enterprises, bajo la licencia CeCILL, compatible con la GNU General Public License.

Las características de Scilab incluyen análisis numérico, visualización 2-D y 3-D, optimización, análisis estadístico, diseño y análisis de sistemas dinámicos, procesamiento de señales, e interfaces con Fortran, Java, C y C++. Mientras que la herramienta Xcos permite una interfaz gráfica para el diseño de modelos.

Estoy teniendo algunos problemas para tomar capturas con mi computadora, asi que les dejare algunos ejemplos de imagenes que saque de internet:

Escilab

Scilab Corriendo en slackware.

Scilab_exemple_3d_2

Ejemplos en 3d.

Xcos-ejemplo

Representación de un sistema realimentado mediante XCOS.
Cualquier duda o comentario, favor de dejarlo abajo.
Fuentes de Referencia:

WSQ14: SciLab

#Tc1017 #SciLab

SciLab is a numerical computation software which is quite handy and also easier to understand than C++ in my opinion, its graphic options are very useful as well, and the handling of matices is definitely more intuitive than in C++.

Understanding SciLab:

  1. On the console screen, we can use the arrows to change instructions and find the history of used commands, kinda like how we use the arrow keys in the compiler.
  2. When using the console we have to input first –> before any command
  3. Basic operations and inserting comments remain the same as in C++.
  4. We can use %e, %pi and %i to represent euler’s constant, pie and complex numbers.
  5. The semicolon is used to avoid any result from beign displayed, no compiling error will occur here.
  6. More useful than the console screen is the editor, which is basically a word processor in which coding becomes easier.

Plotting in SciLab:

  1. Command: plot.
  2. clf menas clear plot, while scf opens another window.
  3. Colors can be added to curves: letter enclosed by “” –> “b” makes blue
  4. Point styles work the same
  5. Segments go in square brackets, point go in round ones.
  6. Statistics: useful for creating bar graphs
  7. Use bar command –> bar (x,n,color)

Creating functions:

  1. Begin: function
  2. End: endfunction
  3. Variables must always have a value, but we don´t have to declare them in advanced😀
  4. Function’s parameters work the same as in C++
  5. Logical operators remain the same, only != becomes <>

Matrices and vectors:

  1. Al operations are done with matrices.
  2. A space or coma separates columns.
  3. Semicolons separate rows.

Loops:

  1. Beggining:step: value –> this way is much simpler than C++
  2. For and while finish with an end.

Revisión del curso

Bueno llego el tiempo de cerrar el semestre, por eso, quisiera dar mi opinion sobre la modalidad de `Flipped learning´, a mi parecer fue una gran experiencia haber tomado este curso, porque en mi caso no solo me enseño de programación, si no, que tambien pude aprender a organizar mi tiempo mejor y ser mas responsable.

El curso impartido por el profesor Ken Bauer es muy flexible, algunos de los puntos mas importantes de este modelo de aprendizajes son:

  • Profesor como guia y no como maestro
  • Auto Aprendizaje
  • Tu te calificas
  • No hay sistema de faltas
  • Redes de aprendizaje entre el salon
  • No hay fechas para entregar trabajos

Todo esto te ayuda a forjar una mayor responsabilidad y me parece muy acertada la manera en que lo maneja Ken, ademas una materia como Programacion donde casi todo lo puedes buscar en internet y siempre es importante seguir aprendiendo por nuestra cuenta, es muy bueno tomarla en este tipo de modalidad.

Como unico punto en contra, diria que las demas clases que llevas en una modalidad normal, por obvias razones son mas estrictas  en cuanto a fechas y entregas, por lo tanto la clase de programacion pasa a ultimo termino, pero esto si te sabes administrar claro que puedes cumplir con todos los trabajos y aprender de una mejor manera.

Aqui les dejo un video donde hablo mas sobre el tema.

Course Review

#TC101 #CourseReview

Programming in C++: Course Review

As we steadily approach the end of the semester, we can now look back on the experiences gained throughout this course and reflect about them.

Since I´m taking this course for the second time now, the experience miaght have been a little different for me than for everyone else, since I was already familiarized with all of the content, yet I didn´t have a perfect understanding of quite a few things.

Before I get into the course topics themselves, I’d like to talk about this new teaching method, the so called “Flipped-Classroom”. For me it was a great idea, it meant I could do my programming whenever I wanted and use the time in class to work on other projects or homework, which I really appreciated since. This had a bad side effect towards the end of the second parcial but I´ll talk about that later.

The fact that we had to upload our Blogs was also a good idea since it forced us to explain ourselves what our programms did, and sometimes that led to us finding mistakes within our codes or a better way to do something. And by making everyone´s code available, it was easy to get past beign stuck by looking at other classmate´s codes.

Now about the bad side effects I mentioned earlier. Since I didn´t go to class all that much, I didn´t get to know many of my classmates, so that really took a hit on the whole social aspect for me. Part of me just wanted to be alone to prove myself I can get this course done by myself, kind of the reason I did the final Project alone, and the less-tech savvy part of myself just wasn´t used to the whole blogging-twitting thing.

Continue reading “Course Review”

QUIZ 7: Dot product

#TC1017 #QUIZ 7

The last of the quizzes. I wanted to import the lists from text files just to practice doing that, but I had a problem with the unknown sizes of the lists, turns out I only managed to get it working properly if I specify before hand how big each list is. Other wise it was a simple quiz for me since I was also working on my sudoku.

Captura.PNG

Source Code:

#include <iostream>
#include <fstream>
#include <vector>
#include <string>

using namespace std;

int CheckIfFirstOpen(string list1){
ifstream ListOne;
ListOne.open(list1.c_str());

if (ListOne.is_open()){
return 1;
} else {
return 0;
}
}

int CheckIfSecondOpen(string list2){
ifstream ListTwo;
ListTwo.open(list2.c_str());

if (ListTwo.is_open()){
return 1;
} else {
return 0;
}
}

vector<int>ReadList1(string list1){
vector<int>List1(4);
ifstream ListOne;
ListOne.open(list1.c_str());

for (int i = 0; i < List1.size(); i++) {
ListOne >> List1[i];
}
return List1;
ListOne.close();
}
vector<int>ReadList2(string list2){
vector<int>List2(4);
ifstream ListTwo;
ListTwo.open(list2.c_str());

for (int i = 0; i < List2.size(); i++){
ListTwo >> List2[i];
}
return List2;
ListTwo.close();
}

int DotProduct (vector<int>List1, vector<int>List2){
int size = 4;
int sum;

for (int i = 0; i < size; i++){
sum += List1[i] * List2[i];
}
cout << “Dot product is ” << sum;
}

int main(){
string list1;
string list2;

cout << “Please enter the name of the first list:” << endl;
cin >> list1;
cout << “Please enter the name of the second list:” << endl;
cin >> list2;

while (CheckIfFirstOpen(list1) == 0) {
cout << “Unable to open first file.” << endl;
cout <<“Please enter the name of the first text:” << endl;
cin >> list1;
}
cout << endl;

while (CheckIfSecondOpen(list2) == 0) {
cout << “Unable to open second file.” << endl;
cout <<“Please enter

Continue reading “QUIZ 7: Dot product”