Data store from file issue

Hi, for my project I need to take information from the text
Text:
NAME YEAR PRICE ID
NAME2 YEAR2 PRICE2 ID2
.... .... ... ... ...
it goes like that for 150,000 lines.
They want me to store them in class like String name , double Price.
Then I will make sort system for it (ex. when user enters ID show the name of that ID )

How can I store them ?
They aren't asking you to store the data in the class. They are asking you to create
a class, and then instantiate (declare) objects of that class type.

Then store the data into those objects.

http://www.programiz.com/cpp-programming/object-class

Think of it this way: A class is merely a blueprint for a house. You can't store anything in the blueprint! But you can build a house from the blueprint! And then you can store whatever you want into that house.

Similarly, the class is the "blueprint" from which our programs will build objects. Once we have the object, the house, we can store data into it.

Joe
Concord Spark Tutoring
sparkprogrammer@gmail.com
thank you but after finding the word and store it which user will enter, how can I show that line. when they enter NAME2 and I need to show NAME2 YEAR2 PRICE2 ID2. and when they enter ID2 I need to show same thing again.
Use a loop of some sort (while or for)
Topic archived. No new replies allowed.