Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/feed-rss2.php on line 8
giorgiodc’s Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Thu, 26 Nov 2015 05:09:39 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ Bonus Quiz https://kenscourses.com/tc101fall2015/2015/bonus-quiz-20/ Thu, 26 Nov 2015 05:09:39 +0000 http://giorgio6859.wordpress.com/?p=115 ]]> Aquí está el link para mi video con mis impresiones del curso.

¡Muchas gracias por todo Ken!

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ14 https://kenscourses.com/tc101fall2015/2015/wsq14-24/ Thu, 26 Nov 2015 03:43:28 +0000 http://giorgio6859.wordpress.com/?p=108 ]]> Este WSQ está más difícil de lo que parece. Tuve que apoyarme mucho en Ken para hacerlo. Ya lo había hecho para un quiz pero me había equivocado porque entendí mal la forma en la que se daba la precisión. Ken me ayudó a entenderlo y pues aquí está el código que hice.

//WSQ14 Euler
#include <iostream>
#include <cmath>
using namespace std;

float fact (float e) {
int q,w;
q = 0;
w = 1;
while (q<e) {
w = w*(q+1);
q = q+1;}
return w;}

// x=número de factorial al que llegará el denominador
int main(){
cout<<“¿Con qué precición quieres el número de euler?”<<endl;
float x;
cin>>x;
int i=1;
float penu;
float s=1;
do{
penu=s;
s=s+1/fact(i);
i=i+1;
} while (abs(s-penu)>x);

cout<<“El número de Euler es “<<s<<endl;
return 0;}

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ13 https://kenscourses.com/tc101fall2015/2015/wsq13-28/ Thu, 26 Nov 2015 03:40:22 +0000 http://giorgio6859.wordpress.com/?p=103 ]]> Para este WSQ vi un video en youtube sobre el método babilónico. Logré deducir casi todo con mi propia lógica pero en un momento llegué a atascarme. Por suerte estaba haciéndola durante mi clase de programación y Ken me dio un empujoncito que me ayudó a ingeniármelas. Aquí está el código.

//Babylonian Method
#include <iostream>
using namespace std;

float bab(int a){
float x=a;
float y=1;
int i=0;
while(i<20){
x=(x+y)/2;
y=a/x;
i=i+1;}
return x;}
int main(){
cout<<“Dame el número para sacarle su raíz cuadrada “<<endl;
int a;
cin>>a;
cout<<“La raíz cuadrada de “<<a<<” es “<<bab(a)<<endl;
return 0;}

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ12 https://kenscourses.com/tc101fall2015/2015/wsq12-29/ Thu, 26 Nov 2015 03:37:33 +0000 http://giorgio6859.wordpress.com/?p=100 ]]> Para este WSQ sólo vi un video en youtube sobre el algoritmo de Euclid y lo demás lo deduje por lógica. Aquí está el código. El operador % ayudó bastante para simplificar la función.

//WSQ12
#include <iostream>
using namespace std;

int gcd (int x, int y){
int yy;
int xx;
int z=1;
while(z!=0){
xx=x;
yy=y;
x=y;
y=xx%yy;
z=(x%y);
}
return y;}

int main(){
int x,y;
cout<<“Dame el mayor valor “<<endl;
cin>>x;
cout<<“Dame el menor valor “<<endl;
cin>>y;
if(y>x){
cout<<“El primer valor debe ser mayor o igual al segundo “<<endl;
}
else{
cout<<“El máximo común divisor es “<<gcd(x,y)<<endl;
}
return 0;}

]]>
https://creativecommons.org/licenses/by/4.0/
WSQ15 https://kenscourses.com/tc101fall2015/2015/wsq15-11/ Wed, 25 Nov 2015 02:36:21 +0000 http://giorgio6859.wordpress.com/?p=96 ]]> For this blog I was supposed to have 4 weeks left but I´ve seen it with just one thay left so my plan is to finish today all the WSQ and finish tomorrow the masteries. 🙂Negro YEAH

]]>
https://creativecommons.org/licenses/by/4.0/
Quiz 11 https://kenscourses.com/tc101fall2015/2015/quiz-11-24/ Sun, 22 Nov 2015 06:02:58 +0000 http://giorgio6859.wordpress.com/?p=89 ]]> Question 1

 

//Quiz Euler
#include <iostream>
using namespace std;

float fact (float e) {
int q,w;
q = 0;
w = 1;
while (q<e) {
w = w*(q+1);
q = q+1;}
return w;}

// x=número de factorial al que llegará el denominador
int main(){
cout<<“¿Hasta qué factorial quieres llegar en el denominador?”<<endl;
int x;
cin>>x;
int i;
float s=1;
for(i=1;i<=x;i++){
s=s+1/fact(i);
}
cout<<“elnúmero de Euler llegando hasta tener el factorial de “<<x<<” en el denominador es “<<s<<endl;
return 0;}

Question 2

//Quiz Banana
#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main(){
ifstream archivo(“archivo.txt”);
string renglon;
int c=0;//contador

while (1){
getline(archivo,renglon);//se hace un string
int x;//Para el for
for(x=0;x<renglon.length();x++){
if(renglon[x]==’b’or renglon[x]==’B’){
if(renglon[x+1]==’a’or renglon[x+1]==’A’){
if(renglon[x+2]==’n’or renglon[x+2]==’N’){
if(renglon[x+3]==’a’or renglon[x+3]==’A’){
if(renglon[x+4]==’n’or renglon[x+4]==’N’){
if(renglon[x+5]==’a’or renglon[x+5]==’A’){
c=c+1;
}
}
}
}
}
}
else{
continue;}
}
if (archivo.eof()) break;//el while se detiene cuando termina el archivo
}
cout<<“La palabra banana se encuentra “<<c<<” veces en el archivo.”<<endl;
return 0;}

]]>
https://creativecommons.org/licenses/by/4.0/
Bonus Quiz https://kenscourses.com/tc101fall2015/2015/bonus-quiz-11/ Fri, 13 Nov 2015 15:14:08 +0000 http://giorgio6859.wordpress.com/?p=85 image

]]>
https://creativecommons.org/licenses/by/4.0/
Final Proyect week 1 https://kenscourses.com/tc101fall2015/2015/final-proyect-week-1/ Sun, 08 Nov 2015 19:51:13 +0000 http://giorgio6859.wordpress.com/?p=83 This week we only saw some tutorial videos to get involved with what the proyect will be about.

Here are the links of the tutorials.

]]>
https://creativecommons.org/licenses/by/4.0/
#Masteries23,24,25 https://kenscourses.com/tc101fall2015/2015/masteries232425/ Thu, 29 Oct 2015 05:49:46 +0000 http://giorgio6859.wordpress.com/?p=81 Creation and use of vectors in C++

Creation and use of arrays in C++

Creation and use of strings in C++

]]>
https://creativecommons.org/licenses/by/4.0/
#Mastery22 https://kenscourses.com/tc101fall2015/2015/mastery22/ Thu, 29 Oct 2015 04:48:04 +0000 http://giorgio6859.wordpress.com/?p=79 When to use what type of repetition in a program

]]>
https://creativecommons.org/licenses/by/4.0/