We’ve come a long way from where we began…

--Originally published at Loading…

 

Well, this is my last post about the programming class, but maybe is not my last post in the life, because this is nice, and maybe I could do it later.

I want to thank Ken for everything in this class, it was one of my favorite classes of the semester. I could remember some things I already knew but I think I learn many more in this time. Thank u for your patient, for teaching us some things and correcting us in our learning and especially, thanks for your friendship.

So, this class is a great help if you want to learn, but if you want to pass the course, I recommend that you don’t be with Ken, you just stress about having to post and get points for no reason. This class is about giving more than just the 100%.  

I hope my other classmates have enjoyed the class as much as I did.

Good luck in the rest of the Tec Life.


Mastery Topics…

--Originally published at Loading…

Number TC1017 Mastery Topic Done? URL to blog post
1 Use of comments ? https://xalli0421.wordpress.com/2017/01/31/numbers-again/
2 C++ Good Style coding conventions ? https://xalli0421.wordpress.com/2017/03/10/distance-gave-us-a-reason-to-love-harder-%F0%9F%92%AB%F0%9F%92%95/
3 Basic types and their use ? https://xalli0421.wordpress.com/2017/02/14/quiz-6/
4 Basic output (print) ? https://xalli0421.wordpress.com/2017/01/20/hello-world-aleluya/
5 Basic user input (text based) ? https://xalli0421.wordpress.com/2017/01/24/lets-have-fun-with-numbers/
6 Calling functions ? https://xalli0421.wordpress.com/2017/02/07/factorial-calculator/
7 Creating functions ? https://xalli0421.wordpress.com/2017/02/07/now-with-functions/
8 Importing and using libraries ? https://xalli0421.wordpress.com/2017/01/28/there-was-quiz-today/
9 Creating and using your own libraries (program with multiple files) ? https://xalli0421.wordpress.com/2017/03/19/ciento-noventa-y-seis/
10 Use of the conditional “if” ? https://xalli0421.wordpress.com/2017/04/18/quiz/
11 Use of “else” with a conditional if ? https://xalli0421.wordpress.com/2017/02/03/xy-and-xx-minimum-and-squares/
12 Nesting of conditional statements (ifs inside ifs) ? https://xalli0421.wordpress.com/2017/01/28/temperature/
13 Use of loops with “while” and “do while” ? https://xalli0421.wordpress.com/2017/01/30/i-have-a-number-chosen-between-1-and-100/
14 Use of loops with “for” ? https://xalli0421.wordpress.com/2017/03/19/ciento-noventa-y-seis/
15 Nested loops ? https://xalli0421.wordpress.com/2017/03/05/fibonacci-number/
16 Use of recursion for repetitive algorithms ? https://xalli0421.wordpress.com/2017/05/03/e2-71828182845904523536/
17 When to use what type of repetition in a program ? https://xalli0421.wordpress.com/2017/05/02/babylonian-method/
18 Creation and use of Arrays/Vectors in C++ ? https://xalli0421.wordpress.com/2017/03/03/list/
19 Creation and use of strings ? https://xalli0421.wordpress.com/2017/05/02/multipart-data-files/
20 Validated user input (ensure correct/expected data entry) ? https://xalli0421.wordpress.com/2017/02/07/factorial-calculator/
21 Reading and writing of text files ? https://xalli0421.wordpress.com/2017/05/03/go-bananas-or-not-sos/
22 Matrixes and Vectors ? https://xalli0421.wordpress.com/2017/03/03/list/
23 Data analysis with tools (to be determined which tool, most likely SciLab) ☹️
24 Visualization of data with tools  ☹️
Transversal Topics
1 Ability to create C++ file and run from command line (terminal) ?
2 Create accounts: Blog, Twitter, GitHub ?
3 Submit work via Blog RSS and GitHub ?
4 Demonstrate use of Linux sufficient for quizzes/exams ?
5 Install Linux on their own computer ?
6 Ability to create C++ project in IDE and run inside the IDE (advanced topic, not needed early) ?

e=2.71828182845904523536…

--Originally published at Loading…

I was a little confused about this, but this classmate’s blog help me a lot, he has very good codes!

Sorry again, I’m a a little pressed with time so I’m not going to explained it. Actually it’s simple, I’m going to leave this link it explained very well and give some examples, I hope it will be useful.

The libraries that I used for this program was the <iostream> & <iomanip>

e

ee


Go Bananas!… or not? (sos!!)

--Originally published at Loading…

Hi, I think today is the most stressful day in the whole semester ‘cause tomorrow is my Physic exam (and I’m not pretty sure about be ready) aaaaaand, I can’t make this program run correctly… so, in this post I’m not going to explain nothing, I just hope some one could help me to make it work.

Banana.png

It’s supposed is fine, buuuuut… when I run it this happens:

bana Please please please, help me.


Project!

--Originally published at Loading…

Well, I I actually wanted to do this post for a long time, but I always forgot or I was lazy… until today!

In this project I am working with José Miguel and Gregorio. At the beginning Goyo and I wanted to make like the Atari game of ping pong… something like that, but then we noticed that may be it could be more harder than it looks, and it isn’t too functional, so we decided to create a Vector Calculator… something like that, because who doesn’t love to add vectors, or get their product point?

First we think it should be easier, just a couple of functions, switch, and that’s it. But then we noticed that  however easy it may be, will be very long. We add structs by operation to make it simpler, and actually we are working in that to finish our project as soon as possible. Personally I think I learned a lot trying to make this project, now I know very well how to use the structs and the switch, also I’m a better planning and thinking my programs.

We hope our project be ready for the Expo Ingenierías, or at least for tomorrow.


Babylonian Method.

--Originally published at Loading…

In this assignment we had to:

 write a function to calculate the square root of a number using the Babylonian method.

When I read it, I thought this would be a bit difficult, buuuuuuut it was pretty easy. First  I investigated about this method, and this page is really good if you want to know about it. Also I found this flow diagram that helped me a lot:

BabMet

So, the first thing that I did was add the <cmath> library. Then following the flow diagram I made my function. I established two variables, the for the result, and dif for the diferencial. First we equate b with x, then made an operation in order to obtain the dif, if dif isn’t it less that 0.00001 the program prints the b, and made an other operation to give another value to to get closer to the square root of x, and made the same until the condition is satisfy.

bab

And here is how it works:

Bab1


Multipart Data & Files

--Originally published at Loading…

Hi!! Is almost the ending of this semester and I promised not to leave everything to the last minute… but here I am… doing all in the last minute.

Today I’m going to explain how I did the #WSQ09. To make this program I asked for help to my friend Jenifer Romero, she explained me everything, but the problem was that we did it on her Mac, so… I had to make some arrangements in order for it to work in my Windows computer.

This is what we had to do:

So for this assignment I would like to see you create a function that receives as parameter the name of a file (this would be a string value like data.txt) and your function counts the number of lines and the number of characters in the file which it returns as a single value (but with two values). You will want to look at how to create/define and return a struct value from a function and how to open and read text files line by line

The first thing I did was to add the two necessary libraries <fstream> & <string>Then, for make the “it returns as a single value (but with two values)” part, I added a struct that I called datos, which stores two int, l (for lines) and c (for the characters). Next, in my function (func) which receives the string url (or ruta) and called the struct. After that I wrote ifstream archivo(ruta.c_str(), ios::in) it associates it with the file name and opens it. I established my variables (at the final I don’t use the char car, ‘cause Ken helped me to do the same with less), and wrote a while for do the things until the

Data01
Data02
Data03
Continue reading "Multipart Data & Files"

Quiz

--Originally published at Loading…

Hi! I know it pass a long time without posting anything, sorry I’m in that point of the semester trying to save it.

And I know maybe this post would be more useful the last week, before the partial, but… I hope it could help you.

1. Distance again.

Actually I’ve already explain this code, and I do the same in this quiz, so I’m not going to explain this one, but here is my code:

Quiz11.1

2. T’s pyramid

This one was kind of difficult because one of my functions was wrong, but technically  it’s veryyyy easy.

I only use the library <iostream>, but I used two functions. The first one was for print the T in each line, for this I used an if and a for, which simply is adding one T in each line of the pyramid. The second function is for print how many lines must have the pyramid, so I use two for, one to increase f (fila) while it’s smaller than n(the number that the user enter). And the other one to decrease f, when it is the same as n and until is 1.

Quiz11.2

3. n!

This one I’ve already explained too, so like the first one, I’m not going to explain it. The only difference is that I made this code more simply like the one that is in the link.

Quiz11.3

4. Average list

This one was kind of easy. First I established the libraries <iostream> and <cmathand as always put the using namespace std;. Then, I created a float function named promedio_lista that receives the sum and returns the prom. Next, in my int main I established two kind of variables, in the float I put the array cal[7] (this ‘save’

Quiz11.4
Quiz11.5.1
Quiz11.5.2
Quiz11.6
Quiz11.7
Quiz11.10
Quiz11.p1
Quiz11.p2
Quiz11.p3
Continue reading "Quiz"

Ciento noventa y seis.

--Originally published at Loading…

This one was very hard! Es por eso que este post lo haré en español, para poder explicar CADA UNO DE LOS PASOS de la manera más clara y sencilla, y así ustedes puedan entenderme y tal vez aclarar sus dudas.

Lo primero que hice, fue descargar la carpeta que Ken tiene en Github, la verdad es que de eso no les puedo decir mucho porque estaba completamente perdida y Ken fue quien instaló todo eso en mi computadora. Después de ver que el código base de YoSoy196 funcionaba, me puse a investigar sobre lo que se supone que debe de hacer este código, vi los videos de Ken y revise los blogs de cursos anteriores, hasta que que encontré el código de Antonio, la verdad me fue de demasiada ayuda, gracias a él comprendí lo que debía de hacer y dejé de estar taaaaan perdida.

So…. lo primero es establecer las bibliotecas que vamos a usar, para que el programa corra necesitamos las bibliotecas string, iostream y BigIntegerLibrary.hh, que está incluida en la carpeta yosoy196 (la que acabamos de descargar). Después debemos de definir las funciones que necesitamos, en este caso solo necesitamos dos. La primer función es el bool is_palindrome, el cual recibe un string para poder analizar los datos, y tiene un if con la condición que si el string i  es leído de la misma manera comenzando en el inicio como en el final, regrese un valor verdadero, de no ser así, regrese falso. La segunda función que usé es BigInteger apply196, que también recibe un string y establece uno nuevo, el cual es el string i leído a la inversa, y por último use stringToBigInteger para que regrese los valores de string a un valor de BigInteger (que es lo que usamos para nuestra variable n), y

01C196.jpg
Diagrama
02C196.jpg
03C196.jpg
196
Continue reading "Ciento noventa y seis."

Distance gave us a reason to love harder ??

--Originally published at Loading…

I know I have a title very “paleta”, buuuuuut Ken’s image really really made me laugh. Anyway the quiz of today was TOO EASY! This was the activity:

Write a function that receives four parameters: x1, y1, x2, y2 which are all floating point values.

The function is called distance and returns (float) the distance between x1,y1 and x2,y2 on the Cartesian coordinate plane.

So the first thing was to established the libraries that I’ll use, iostream & cmath. Then, I wrote my function, actually it was easy, I just used the Pythagoras’ Theorem

pythagorean_theorem11

One corner is one of the coordinates (X1, Y1), and the other (non the 90° corner) is the other coordinates (X2, Y2). So, in order to calculate a and b I used the logic and the Cartesian coordinate plane, now a is (X2 – X1), b is (Y2 – Y1) and c is the distance. To calculate the distance I used a sqrt and pow to raise to the square a and b.  This is my code, to be more clearly:

Distance

And this is how it works:

Distance01