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
alan46bc’s Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Wed, 25 Nov 2015 23:39:59 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ Masteries 24 y 25 https://kenscourses.com/tc101fall2015/2015/masteries-24-y-25/ Wed, 25 Nov 2015 23:39:59 +0000 http://alan46bc.wordpress.com/?p=117

]]>
https://creativecommons.org/licenses/by/4.0/
Masteries 21 y 23 https://kenscourses.com/tc101fall2015/2015/masteries-21-y-23/ Wed, 25 Nov 2015 23:39:11 +0000 http://alan46bc.wordpress.com/?p=115

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 17 https://kenscourses.com/tc101fall2015/2015/mastery-17-13/ Wed, 25 Nov 2015 23:38:29 +0000 http://alan46bc.wordpress.com/?p=109 ]]> Captura de pantalla 2015-11-25 a las 17.34.16

Aquí usamos el switch para que si metemos el valor 1 nos de un resultado y si usamos el 2 nos dé otro.

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ17 The last one https://kenscourses.com/tc101fall2015/2015/wsq17-the-last-one/ Wed, 25 Nov 2015 22:21:38 +0000 http://alan46bc.wordpress.com/?p=102 This one was really easy I only download it and install it.

wsq17.2
wsq17

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ16 https://kenscourses.com/tc101fall2015/2015/wsq16-12/ Wed, 25 Nov 2015 22:09:34 +0000 http://alan46bc.wordpress.com/?p=96 ]]> #include <iostream>
#include <string>
#include <fstream>
#include <sstream>
using namespace std;

int main (){
string Read;
string mid_price;
string city_mpg;
string high_mpg;
int n = 57;
float city;
float avg_city = 0.0;
float high;
float avg_high = 0.0;
float price;
float avg_price = 0.0;

ifstream read_file(“93cars.dat.txt”);
if (read_file.is_open()){
for (int i =0; i < 93; i++){
getline(read_file, Read);
mid_price = Read.substr(42,4);
istringstream buffer(mid_price);
buffer >> price;
city_mpg = Read.substr(52,2);
istringstream buffer2(city_mpg);
buffer2 >> city;
high_mpg = Read.substr(55,2);
istringstream buffer3(high_mpg);
buffer3 >> high;
avg_high = avg_high + high;
avg_price = avg_price + price;
avg_city = avg_city + city;
getline(read_file, Read);
}
read_file.close();
}else{
cout << “Failed opening the file” << endl;
}
avg_price = avg_price/93;
avg_city = avg_city/93;
avg_high = avg_high/93;
cout << “Average midprice: ” << avg_price << endl;
cout << “Average City MPG: ” << avg_city << endl;
cout << “Average Highway MPG: ” << avg_high << endl;
return 0;
}screen5

This one was a easy but a little tricky I think but at the end I could make it work.

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ15 https://kenscourses.com/tc101fall2015/2015/wsq15-17/ Wed, 25 Nov 2015 21:58:20 +0000 http://alan46bc.wordpress.com/?p=90 ]]> I didn’t read this WSQ until now. My schedule is only for today because it’s the last day to upload everything, so I’m gonna end the rest of the wsqs and submit my masteries.

laugh

 

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ14 https://kenscourses.com/tc101fall2015/2015/wsq14-15/ Wed, 25 Nov 2015 21:52:41 +0000 http://alan46bc.wordpress.com/?p=84 ]]> #include <iostream>
#include <cmath>
using namespace std;

long double precision( int n, long double e)
{
if (n == 0){
return ceil (e);
} else if (n == 1){
return floor ((e * 10 ) + 0.5) / 10;
}else if ( n ==2){
return ceil((e * 100 ) + 0.05) / 100;
} else if ( n == 3){
return floor ((e * 1000 ) + 0.005) / 1000;
} else if (n == 4){
return floor ((e * 10000 ) + 0.0005) / 10000;
}else {
return e;
}
}

long double calculate_e (){
long double e = 2.5;
long double c = 2.0;
long double d, factorial;
for (int i=0;i<5;i++){
c = c + 1.0;
d = c;
factorial = c;
while (d>1){
d = d – 1.0;
factorial = factorial * d;
}
e = e + (1.0/factorial);
}
return e;
}

int main(){
int n;
cout << “numero de decimales que desees entre 0 y 5″<< endl;
cin>> n;
long double e = calculate_e ();
long double e2 = precision(n, e);
cout << e2 << endl;
return 0;
}screen4

This one was really difficult, at first I didn’t understand what to do but I read the link that was on the wsq and read other post to understand what to do.

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ13 https://kenscourses.com/tc101fall2015/2015/wsq13-21/ Wed, 25 Nov 2015 21:37:19 +0000 http://alan46bc.wordpress.com/?p=79 ]]> #include <iostream>
using namespace std;

float raiz (float a){
float x = a / 2;
for (int i=0; i <20; i++){
x = .5*(x+(a/x));
}
return x;
}

int main (){
float a, r;
cout << “Escribe un numero al que quieras sacarle su raiz cuadrada “;
cin >> a;
float s = raiz (a);
cout << “la raiz cuadrada de  ” << a << ” = “<< s << endl;
return 0;
}screen3

This one was a bit hard but I research some information on the internet and I could make it.

]]>
https://creativecommons.org/licenses/by/4.0/
#WSQ12 https://kenscourses.com/tc101fall2015/2015/wsq12-22/ Wed, 25 Nov 2015 21:22:11 +0000 http://alan46bc.wordpress.com/?p=73 screen2.png

This one was really easy.

]]>
https://creativecommons.org/licenses/by/4.0/
QUIZ 11 https://kenscourses.com/tc101fall2015/2015/quiz-11-14/ Sun, 22 Nov 2015 03:13:34 +0000 http://alan46bc.wordpress.com/?p=67 This one was really hard but I read soe posts of my classmates to understand it.

pantalla4
pantalla5

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