Author Archives: Eduardo Tostado

Bonus

Hello people

I created a video in which I tell my experience in Ken´s class, and how to be succesfull on it (from my point of view). I hope you like it.

Here´s the link https://www.youtube.com/watch?v=q1LtC6GJQtI&feature=youtu.be

1017

Final Project (Sudoku)

Hello everybody:

We are finally done with our final proyect. 

At the beginning I thought that creating a sudoku was going to be very complicated, but then, Ken told me that the key on this was to divide the project in small different pieces and work on them one by one. In our case, those little pieces were functions that we implemented in our code.

Our code has ten different functions (not including our main function). The reason why we have all those functions, is beacuse we decided it was going to be easier if we worked on one condition at a time. We have a function that checks for the row in our table, another one that checks for the column, another one for the quadrant, another one for the range, another one that prints the board, etc. 

I think the most complicated part was to understand and visualize what a double vector is, because the project is literally based on that concept. 

Complications:

There were three steps during the creation of the sudoku that were a bit more complicated than the others: checking for the quadrat, implementing colors, and correcting our “chekingrow” function.

We we implemented the function that cheks for the row, it was working but not as we wanted it to. If the number was already in that row, a message was sent to the user, but the number was still placed in that invalid space. The problem was that our condition was not correctly placed, so the complicated part here was identifying where the condition should have been.

The second difficult part of this project was checking the quadrant of the number. At the beginning I had no idea of how to do it, but Ken explained us (Juan and me) that it had to be done by dividing and multiplying the position by/times three and then creating a double for loop that checked only that specific quadrant. The complicated part here was not creating the function, but being creative in order to know how to do it. 

Finally, the most complicated of the three was implementing colors. Until now,  I had never used colors in C++, so it was a bit complicated to find the correct way to implement them. The syntaxis was not difficult, the real challenge (at least for us) was to find the information on how to do it. 

 

My partner for this project was Juan Mercado, and I had a very good experience working with him. It was very easy to organize the project, and we were always telling the other what we were doing and what problems we were having. I strongly recommend him as a project partner. 

 

As a conclution, I personally think this was a very good project because it makes you realize you can actually create cool stuff with programing. At the beginning I thought it was going to be tyring and complicated, but once I started working on it, I realized it was actually very interesting. By the way, it is just amazing when one of your functions does what you want it to do. 

 

Here´s the link of our code

https://github.com/kenwbauer/EduardoJuan/blob/master/sudoku.cpp

 

1017

Mastery 27

Hello people:

For mastery 27 I created a program that asks the user for different numbers and it checks that the user is actually introducing what the program is asking to. Take a look at the code:

 

In this program the user is asked to introduce and integer number, and if she/he introduce for example a number with decimals, the program does not accept the input and it keeps asking for an integer until the user introduces the correct number.

In the second part, the user is asked to introduce a number between an specific range, and the same thing hapens if the user introduces a number out if the range. 

Validating user input might be a bit complicated because the user can introduce whatever she/he wants, and sometimes an incorrect input might cause a program to explote.

 

Mastery 25 (strings)

Hello everybody:

For this mastery I will show you three pictures of three different programs I created in which I used strings. Let´s remember that strings represent series of characters, so take a look at these programs, and see how I used them.

In the first one, I used a string to define the first line in the .txt file I took the data from. After that I used the substring statement to  select only the part of the data I nedded of each line, and finally I just converted the string to a float using the atoi function.

 

In the next program I used a string for the same purposes that in the first one. The string defines the first line of the file, but by using a loop, every single line in the file is eventually checked. In this case I didn´t use the substring statement because I needed all the data in each line (the line was jus a number). As I did in the first program, at the end I just converted the string to a float by using the atoi function. 

,   

 

In the last program, I also defined the first line of the program as a string, but in this case the program has to identify how many times the word “banana” appears within the file. I had to use the function “transform” to change all capital letters to non-capital so the program would count “BanAna”,  “BANANA” “banana” or any other mix. The last thing I had to do was to use the function find in order to check for the word I nedded. 

As you can see, strings are not that complicated to use and they can be used to many different aplications. I hope you guys find this useful.

Thanks for reading.

 

Mastery 13

Hello people:

For mastery 13 I created another PDF tutorial that explains the basics of libraries in c++. Since there are so many different headers, I also included a link to a web page that shows all the libraries c++ contains. I hope you find it useful.

https://drive.google.com/file/d/0B5CZIHLkZcDzRmdldXFZR1ZzOXc/view?usp=sharing

WSQ17

Hello everybody

For WSQ17 I first downloaded Scilab and I read the pdf tutorial that explains the basics of the program. I personally think it is very useful, specially because you can create 2D and 3D plots, and because you can actually programm whitin the console.

Here´s a picture of my console when I was discovering how to plot 

 

 

Quiz 11

Mastery 28

Hello people:

For my ,astery 28 I created a PDF tutorial in which I show three small examples on how to read from a file and write on a file in c++. I hope you find it useful.

Here’s the link https://drive.google.com/file/d/0B5CZIHLkZcDzUUFOQXVGeDRPZlk/view?usp=sharin

WSQ16

Hello everybody:

Here´s the link of my WSQ16.

https://github.com/JEduardotostado/TC1017/blob/master/WSQ16.cpp

Mastery 17

Hello everybody:

For mastery 17 I created a PDF tutorial explaining the basic aspects of the switch statement, and how can it be used as a conditional. I hope you find it useful.

Here´s the link so you can check it:

https://drive.google.com/file/d/0B5CZIHLkZcDzYUF1SXkwVzFXSmM/view?usp=sharing