Picture by Pixabay
Hi guys in this WSQ 11 Fabrizzio Cortez helped me a lot with his video.
Pretty much this are the steps:
- Import the library of fstream
- 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.
- 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.
- break: ends the infinite loop
- This function will return the number of bananas in each line
- Next function: open the text file, read it and made a counter that counts the accumulating bananas in each line of the text
- Finally in the int main: final counter, this will use the last functions and the return values will be returned.
Code:
Code at GitHub
L.out