tc1017, Uncategorized

WSQ 13…

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:

This slideshow requires JavaScript.

Scilab_beginners (1)introscilab

Standard
tc1017, Uncategorized

WSQ 12…

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

 

Standard
tc1017, Uncategorized

WSQ 11…

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

 

 

Standard
tc1017

Final Project…

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 teammate, but there were some problems with my old team.  Now it doesn’t matter because I could finish my project. I had fun and I learned a lot when working with my project and during the whole course. Thanks a lot.

 

 

 

 

Links:

https://www.tutorialspoint.com/c_standard_library/ctype_h.htm

http://www.cplusplus.com/reference/sstream/stringstream/

http://www.cplusplus.com/forum/beginner/83024/

GitHub: https://gist.github.com/CesarR99/56f095ccb1832995661dedecf93f7b56

 

Standard
tc1017, Uncategorized

Mastery Topics Pt2……

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.

Standard
tc1017

WSQ08…

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

 

GitHub: https://gist.github.com/CesarR99/1b256eebe360b39100123ca48ea25727

Standard
tc1017

The more you know…

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

Standard
tc1017

Logic of Signs

In programming the symbols or signs have a different type of logic, this means that they are not exactly the same like when we use them normally. Here you can find a picture a chart to undertand it better. But at this point of the semester you should already be familiar with this…

 

 

Standard
tc1017

My final project…

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)*

I will be getting help from anothet team that will be doing a tic tac toe too and from here:  http://www.cplusplus.com/forum/beginner/83024/

***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.

Week 2 (from 6/11 to 10/11): Develop the code and look for tutorials.

Week 3 (from 13/11 to 17/11): Prove my programm, ask Ken for help and check for errors.  THE END.

Standard
tc1017

WSQ10…

For this programm we had to create a function to calculate the square of a number using the babylonian method. First, I had to investigate what the heck was the Babylonian Method because I had no clue. It was easy after I found this flowchart that I will post below. Also I included another function that calculated the square root in the traditional way just to verify that the babylonian method was correct.

***Important stuff***

+Functions are everything. Basically this partial was all about functions.

+Remember there are several ways to do the same thing.

+Do your programms by parts.

 

22773381_1987404944806396_2038242645_n (1).png

GitHub: https://gist.github.com/CesarR99/4321422d66ec668c46efdb6f724418a3

 

Standard