jeudi 5 novembre 2015

Reading data from files from a user input

So I have a text file that I've made up with a persons name followed by a comma and then a place where they could live. Yes I know its random but I need a way to understand this :)

So here is the text file (called "namesAndPlaces.txt"):

Bob,Bangkok
Ellie,London
Anthony,Beijing
Michael,Boston
Fred,Texas
Alisha,California

So I want the user to be able to enter a name into the program and then the program looks at the text file to see where they live and then prints it out to the user.

How can I do this? Thanks Michael

Aucun commentaire:

Enregistrer un commentaire