BANG!ana

Picture by Pixabay Pixabay

Hi guys in this WSQ 11 Fabrizzio Cortez helped me a lot with his video.

Pretty much this are the steps:

  1. Import the library of fstream
  2. First function:  for loop where if i is smaller than the length then with the function to lower the program will change all the letters to lower case.
  3. Infinite loop that only stop if you break it and in this I find the number of bananas of each line, and the program saves that info.
  4. break: ends the infinite loop
  5. This function will return the number of bananas in each line
  6. Next function:  open the text file, read it and  made a counter that counts the accumulating bananas in each line of the text
  7. Finally in the int main: final counter, this will use the last functions and the return values will be returned.

 

Code:

Captura de pantalla 2017-05-02 a la(s) 18.23.31.png

Captura de pantalla 2017-05-02 a la(s) 18.23.44.png

Captura de pantalla 2017-05-02 a la(s) 18.23.53.png

Captura de pantalla 2017-05-02 a la(s) 18.26.56.png

Captura de pantalla 2017-05-02 a la(s) 18.23.16.png

Code at GitHub

L.out

Deja un comentario