Quiz program, array help

Page 1 of 1

1 Replies - 518 Views - Last Post: 06 November 2012 - 09:41 AM Rate Topic: -----

#1 ryan449  Icon User is offline

  • New D.I.C Head

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

Quiz program, array help

Posted 06 November 2012 - 07:59 AM

I am trying to make a quiz with visual basic, i have to load the quiz from a text file in this format:
question, answerA, answerB, answerC, answerD, Actual answer
Question2,answer a, answer b, answer c, answer d, Actual answer
Question3..... and so on

i need a way that when i press next, the next question will show up. Right now the text file is in an single dimension array so question(0) would be the question and question(6) would be the second question

[/ FileOpen(1, "quiz.txt", OpenMode.Input) 'open file to input all questions into an array
'Loop to input questions into array
Dim questions(Counter - 1) As String
For index As Integer = 0 To Counter - 1
Input(1, questions(index))
Next

questionBox.Text = questions(0)

answerBtnA.Text = questions(1)
answerBtnB.Text = questions(2)
answerBtnC.Text = questions(3)
answerBtnD.Text = questions(4)

FileClose(1)


End Sub

]

Any help would be great, I am completely stuck

Is This A Good Question/Topic? 0
  • +

Replies To: Quiz program, array help

#2 tlhIn`toq  Icon User is offline

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

Reputation: 5440
  • View blog
  • Posts: 11,672
  • Joined: 02-June 10

Re: Quiz program, array help

Posted 06 November 2012 - 09:41 AM

Please don't create multiple threads for the same question.
You already have a thread going for this:
http://www.dreaminco...1&#entry1739431

Also, please follow the guidelines about using code tags just like everyone else.
We can't make it much more obvious than in the box where you typed your question.
:code:

Attached Image

If you check the homework help link in my signature block you'll see there is a section devoted to this common homework task of making a quiz program.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1