Hello. I have a program that would have to search in a text file like this:
ovelha animal
gato animal
joão humano
arvore planta
I need a method, which receives a string, evaluates based on that file if that string is there, for example the method receives the string "cat", which is there then it returns the string "animal" if it received the string "john" would return the string "human", and so on, but if it received something that is not in the list, it would return "error", or something like that. I have no idea how to do this: P Thanks in advance