--Originally published at Valeria CT
For this assignment I created the function find_banana(), which received a string, like Ken asked. In the main I opened the .txt file, converted everything to lower case and then called find_banana(). I used nested conditionals and nested loops. Here’s my code with everything explained, feel free to ask me if you have questions!
https://github.com/valeriact/tc1017/blob/master/wsq11.cpp
Resources:
- https://stackoverflow.com/questions/3867890/count-character-occurrences-in-a-string
- How To Think Like a Computer Scientist
-Valeria
![](https://pixel.wp.com/b.gif?host=valeriactblog.wordpress.com&blog=133881743&%23038;post=239&%23038;subd=valeriactblog&%23038;ref=&%23038;feed=1)