WSQ 13…

--Originally published at tc1017 – chivas4ever2009

Working, playing or however you want to call it with SciLab. I did some basic stuff, basic operations, I worked with constants, also with functions and additionally I worked with graphs and diagrams.

I find it to be a very useful tool like Ken said. Maybe in the future I will be using it, I think it will be way more easy. It is ilke programming, and since I already took a course of one of most difficult languages for programming (C++), I think and I hope wont be having problems with this.

Here you have some basic introduction files:

Click to view slideshow.

Scilab_beginners (1)introscilab


WSQ 12…

--Originally published at tc1017 – chivas4ever2009

Objective:

Ken asked to create a programm to estimate the value of the constant  “e” = 2.71……(Easy).

I said it is easy because there exists a library in C++ with plenty of Math constants. (_USE_MATH_DEFINES). There you can find the value of pi, e, log and square root.

In this case you need e = M_E.

Then we should create a function that received one parameter thar reached the precision of the value asked by user through an input.

***Important stuff***

  • The use of libraries. When you can get the constant then you can compare it with function you created. That is what I did, I printed both values: the cosntant and the one calculated. To compare both of them and see if I was doing it right.
  • Reading instructions. This is a tricky one, at first I thought it was asking for decimal places of the e value. It was not clear, then Ken told us that in real life it was like that. With the clients or with workmates, sometimes they are not very clear of what they want, but you as an engineer must figure out what does the client wants2017-11-24 (2).

 

 

Links:

https://www.quantstart.com/articles/Mathematical-Constants-in-C

GitHub: https://gist.github.com/CesarR99/d377e4053691464b5a8c01e15f9da623

 


WSQ 11…

--Originally published at tc1017 – chivas4ever2009

Objective:

Ken asked us to create a programm that searched and counted the word “banana” in a file through a function that recieved a single parameter and returned a positve integer that would be the number of times banana is in the document.

It was easy and I find it useful. Maybe when you are doing an essay you need to search for a specific word, or in a long file you need to find a key word. With this programm you will find what you are looking for.

*When looking for a word in a document like a PDF on the internet press F3. And in Word press Control + B, depending in your computer it should work.

***Important stuff***

  • The difficult part for me it was setting as equal: lower case letters and uppercase letters. But on the internet I found it was not so difficult. The function tolower must be introduced in your programm.
  • Also another mistake I had it was that I was not saving my file as .txt . Something super easy, a dumb mistake and very basic.
  • 2017-11-24

2017-11-03 (1)2017-11-03

Links: http://www.cplusplus.com/reference/cctype/tolower/

GitHub: https://gist.github.com/CesarR99/48fbd26c375b8709afeb3a34ccefc4fc

 

 


Final Project…

--Originally published at tc1017 – chivas4ever2009

Ken said to us since the beginning of the semester that the final project could be anything we wanted. And that was quite motivating since the project should be or must be something that we are interested in. My project was to programm a Tic-Tac-Toe game, it was not my first choice. My project changed because some stuff that happened, so my final project decision was this: a Tic-Tac-Toe game. It sounds easy but it is not, I had to work a lot  and to type a lot of code.

***Here is what I learned:

-Cases: Or also called switch statement I think. It works as a menu or that is what I understood. Actually I worked in a programm with cases that was an ATM. Cases work depending on the case literally, when a condition matches with a case that case will be working. The same way that in a menu depending on what you choose or on what the programm do. I am sure this specific ‘function’ will be useful for my future coding.

-Game(in the code): It is like a tag or a chekpoint to know wheen to start or stop doing something.

-The use of libraries:

       #include <sstream> I learned that this it is a library that include streams and inside they contain strings and this can be useful for employing stream-style manipulation.

     

#include <ctype.h>  I learned that it is a library that declares several functions that are useful for testing and mapping character.

-for(;;) : This is for running a program for infinite times. When it finishes, it starts again and again.

-Working alone: For a final project it was really hard because I had no one to get help from. I admit I did needed a

Continue reading "Final Project…"

Mastery Topics Pt2……

--Originally published at tc1017 – chivas4ever2009

WSQ#06

+Use of recursion for repetitive algorithms.

+When to use what type of repetition in a program

WSQ#07

+Creation and use of Arrays/Vectors in C++

WSQ#08

+Creation and use of strings.

+Matrices and Vectors.

WSQ#09

  • Validated user input (ensure correct/expected data entry)
  • Reading and writing of text files

WSQ#10

+Basic types and their use.


WSQ08…

--Originally published at tc1017 – chivas4ever2009

Finally, ladies and gentleman, here you have my last programm for Partial 2.

The objective was to get the palyndrome and the lycherel numbers from a range of numbers asked to the user. It was a disaster. It did not worked, but I do not consider it a failure because after more than 70 lines of coding I can say I learned a lot. First of all because I finally worked with vectors, I did not wanted to because I thought they were too complicated. I must thank Damian for helping me get along with vectors. Then as everyone knows we had to import another library and we also needed to know how to make it work, that was fine thanks to the video of Ken. The complexity of this programm was that it was too long, I got lost and therefore I could not fix my coding. At least I can say I learned lots of new mathematical concepts during this partial like: Palindromes, Lycherel and Babylonian Method. Here is my code, the video of Ken and definition of the Palindrome/Lycherel numbers.

Links:

https://mattmccutchen.net/bigint/

http://mathworld.wolfram.com/LychrelNumber.html

http://mathworld.wolfram.com/PalindromicNumber.html

 

 


The more you know…

--Originally published at tc1017 – chivas4ever2009

Hello to everyone this is a brief post of what I discovered today. It  will be very useful for those of you who are using Atom. (Probably everyone in the class) Today I found out that when you open Atom there is like a menu of options, and most of the times we ignore it and close it immediately. But I don’t know why today I did not close it immediately, for some reason I read the options from that menu. The thing I found out is that there is an option that is called ‘Learn Keyboard Shortcuts’ and that is it. There you can find several and useful shortcuts that you can use while writting your code. That is all.

2017-10-28


My final project…

--Originally published at tc1017 – chivas4ever2009

For my final project I did some changes. I was not sure of my idea, but finally I decided that my project was going to be…..

*Programming a Tic-Tac-Toe or ‘Gato’ (in Spanish)*

***Important stuff***

+It seems to be something simple or super easy, but it is not.

+It is complicated and long, do not subestimate the complexity of this code.

+Since it is a game you have to be prepared for any input or situation done by the user.

+Lots of functions have to be used.

 

gato.png

Due Dates: 

Week 1(from 30/10 to 3/11): Set up the project with the ideas and the design.