2 Replies - 604 Views - Last Post: 06 November 2012 - 01:58 PM Rate Topic: -----

#1 ryan449  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 22-October 12

Text File questions

Posted 06 November 2012 - 06:19 AM

I am trying to find a way to count the number of lines in a text file as a quiz for example:
Question,answer1,answer2,asnwer3,asnwer4,answer
Question2,answer,answer,answer,answer,realanswer

The answer i want to get is 12.. 6 on each line.

After i do that I need to get each piece into a variable.. for example questionOne(0) would be the very first then question(1) would be answer 1...

Any help, or if anyone has a better idea on how to do that, I am making a quiz program, and I am at a complete lost. Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Text File questions

#2 ryan449  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 22-October 12

Re: Text File questions

Posted 06 November 2012 - 06:28 AM

I have the counter working.. Now its to store the each line in an array or somehow to store each item separately
Was This Post Helpful? 0
  • +
  • -

#3 tlhIn`toq  Icon User is online

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5520
  • View blog
  • Posts: 11,829
  • Joined: 02-June 10

Re: Text File questions

Posted 06 November 2012 - 01:58 PM

Please read the article linked in my signature block: Homework help.
One of the case studies is how to build a quiz program.

Please tell me you don't really have a Question1, Question2, Question3 set of variables.
You are using an array of Question objects (class instances) right?

Here is another thread for the same homework, just in a different coding language that isn't 20 years out of date. Maybe it will help.
http://www.dreaminco...7&#entry1739847
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1