I really liked having this class with Ken. I think he is a great teacher that used a completely different system that what we are all used to, so that makes it challenging but rewarding. At first I was really scared of this course since I had no idea how to program or anything related to it, but I leart the basics of c++ in a semester. I really liked how this class was relaxing since we could practically do anything in it, but somehow I managed to keep up with the rythm and learn. I would totally recommend to take this course to anyone who asks me. I think he is a great teacher that dedicates his time to his students, during and after classes, he always has an open door.
I have partnered up with Oscar to do this semester’s project. We are going to do a game that guesses the character of Game of Thrones you are thinking of by asking the user a set of questions. You can check out Oscar’s post por a further description of the project and the schedule we are going to be working on.
Ind this assignment I learnt how to find a specific string in a file, in this case the word banana. I used the function line.find(“banana”).
First I made the function work by searching only for the word banana, with lowercase. I made a loop inside of a loop so that if the a word banana was found in a line it wouldn’t just jump right to the next line, instead it would keep looking in the same line until all the bananas were found.
When the code worked I added a new function called transform to convert all the strings in the file to lowecases. This way, it wouldn’t matter if the word was written as Banana or banAna, because it would be converted to just “banana”.