WSQ09 :)

--Originally published at Tec Life

So, hello againnnn, this is the problem for this week:

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.

So, how do I start???

First of all I include to new libraries :

  1. fstream: To be able to read a file.
  2. String: To use my get line function.

Then I declare my to variables “palabras and lineas” with a value of cero, then I make that my program will make a text file called texto.txt and then I put my if stream because we are going to put things on the program in other words “if = in, ofs= out”.

Then I make to open my file with open and the name of my file, and what would happened if it fail and to do that while is open and its going to add one value to lineas and palabras.

I really don’t know how to explain it right because if you don’t know so much things you will never know what I am doing. So read your textbook and search information on internet about this problem, because it was a hard one.

See you laterrrrr.

Captura de pantalla 2017-03-11 a la(s) 10.04.58.png

Image from: https://clipartfest.com/categories/view/382647a840319bed4aa74f8b873e6b3c85a45d91/open-book-with-words-clipart.html


WSQ09 :)

--Originally published at Tec Life

So, hello againnnn, this is the problem for this week:

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.

So, how do I start???

First of all I include to new libraries :

  1. fstream: To be able to read a file.
  2. String: To use my get line function.

Then I declare my to variables “palabras and lineas” with a value of cero, then I make that my program will make a text file called texto.txt and then I put my if stream because we are going to put things on the program in other words “if = in, ofs= out”.

Then I make to open my file with open and the name of my file, and what would happened if it fail and to do that while is open and its going to add one value to lineas and palabras.

I really don’t know how to explain it right because if you don’t know so much things you will never know what I am doing. So read your textbook and search information on internet about this problem, because it was a hard one.

See you laterrrrr.

Captura de pantalla 2017-03-11 a la(s) 10.04.58.png

Image from: https://clipartfest.com/categories/view/382647a840319bed4aa74f8b873e6b3c85a45d91/open-book-with-words-clipart.html


First Impression

--Originally published at Tec Life

I think the first impressions are not everything because I do not think you can know how a person is in a day.

But with my first impression in Ken´s class was very good, because I think we would learn one thing that other teachers does not teach  us “Responsibility” as he told us in the class.

I think I would be able to do a lot of things on the computer by the end of this semester in Ken´s class and I think I would learn a little more about how the internet works. I am very exited for the next class and I am sure that this class is going to be outside this world.