Simple Quiz programUrgent help needed.
Page 1 of 1
8 Replies - 39811 Views - Last Post: 13 February 2007 - 12:56 PM
#1
Simple Quiz program
Posted 12 January 2007 - 01:59 PM
Hi,
I've got an assignment from my tutor to create a simple quiz game with 6 questions. I'm really struggling with this, I like programing but I'm finding it hard. I have started on it, this is what I have so far (with the help of my friends)
I have the front page, and instructions page linked to the front page by a button, the 6 questions to display and 3 radio buttons as the answers. However I have no idea how to make it check if the answers are correct, or how to reset each question so the radio buttons are not checked.
I also have another form which I want to display after the last question is answered, on this form I want it to display the users score.
Can any body help me with this, even if it is just a little I'd be really grateful. I need to have it done or at least improved by Tuesday.
Thanks
Charlie
I've got an assignment from my tutor to create a simple quiz game with 6 questions. I'm really struggling with this, I like programing but I'm finding it hard. I have started on it, this is what I have so far (with the help of my friends)
I have the front page, and instructions page linked to the front page by a button, the 6 questions to display and 3 radio buttons as the answers. However I have no idea how to make it check if the answers are correct, or how to reset each question so the radio buttons are not checked.
I also have another form which I want to display after the last question is answered, on this form I want it to display the users score.
Can any body help me with this, even if it is just a little I'd be really grateful. I need to have it done or at least improved by Tuesday.
Thanks
Charlie
Replies To: Simple Quiz program
#2
Re: Simple Quiz program
Posted 12 January 2007 - 02:59 PM
if you create the radio buttons as an array you could use a Select Case routine to check which one is checked.
create an array for your questions and answers.
Dim Question(6,2) as String
Question(0,0) = "Are you a Human?"
Question(0,1) = "1"
etc.
create an array for your questions and answers.
Dim Question(6,2) as String
Question(0,0) = "Are you a Human?"
Question(0,1) = "1"
etc.
This post has been edited by KeyWiz: 12 January 2007 - 02:59 PM
#3
Re: Simple Quiz program
Posted 13 January 2007 - 11:47 AM
[quote name='KeyWiz' date='12 Jan, 2007 - 02:59 PM' post='195658']
if you create the radio buttons as an array you could use a Select Case routine to check which one is checked.
create an array for your questions and answers.
Dim Question(6,2) as String
Question(0,0) = "Are you a Human?"
Question(0,1) = "1"
Hi, thanks for that.
Your gonna think I'm thick for asking this but, how do I create an array?
Would it help if I posted the code I have already scraped together.
Thanks again.
if you create the radio buttons as an array you could use a Select Case routine to check which one is checked.
create an array for your questions and answers.
Dim Question(6,2) as String
Question(0,0) = "Are you a Human?"
Question(0,1) = "1"
Hi, thanks for that.
Your gonna think I'm thick for asking this but, how do I create an array?
Would it help if I posted the code I have already scraped together.
Thanks again.
#4
Re: Simple Quiz program
Posted 13 January 2007 - 11:53 AM
read this article http://www.dreaminco...wtopic20197.htm
and download and look at this code
http://www.dreaminco.../snippet643.htm
and download and look at this code
http://www.dreaminco.../snippet643.htm
This post has been edited by KeyWiz: 13 January 2007 - 11:55 AM
#5
Re: Simple Quiz program
Posted 13 January 2007 - 04:05 PM
Hi, me again
I've done an array (thanks for that info btw), however I'm puzzled by the select case bit now.
After this it should be finished, I just need to make it calculate the users score at the end by adding up each question, this is the bit I'm really struggling with. Will the select case do this for me?
Thanks
Any helped greatly received.
I've done an array (thanks for that info btw), however I'm puzzled by the select case bit now.
After this it should be finished, I just need to make it calculate the users score at the end by adding up each question, this is the bit I'm really struggling with. Will the select case do this for me?
Thanks
Any helped greatly received.
#6
Re: Simple Quiz program
Posted 13 January 2007 - 10:20 PM
Select-Case was designed to do away with the need to compare one term to many options. For instance here is a series of If-Then statements:
Now, this is fine and works perfectly, but extend it and you can see that this would take a lot of processing time to execute.
So Select-Case was created to speed it up, here is the same code as above, but in Select-Case
The BIG difference, besides cutting down on typing, is the Select Case will automatically jump past all non-matching cases and is much faster than the If-Then series.
If a = 1 Then b = a+1 If a = 2 Then b = a+9 If a = 3 Then b = a+5 If a = 4 Then b = a+7 If a = 5 or a = 6 or a = 7 Then b = a+3 If a = 8 or a = 9 Then b = a+5
Now, this is fine and works perfectly, but extend it and you can see that this would take a lot of processing time to execute.
So Select-Case was created to speed it up, here is the same code as above, but in Select-Case
Select Case a Case = 1 b=a+1 Case = 2 b = a+9 Case = 3 b = a+5 Case = 4 b = a+7 Case = 5, 6, 7 b = a+3 Case = 8, 9 b = a+5 End Select
The BIG difference, besides cutting down on typing, is the Select Case will automatically jump past all non-matching cases and is much faster than the If-Then series.
#7
Re: Simple Quiz program
Posted 19 January 2007 - 01:14 PM
Thanks, I've done all the code now.
Thanks for all your help.
Do you know how I can create test data for my program, I have been asked to do this but I'm not sure how.
Thanks for all your help.
Do you know how I can create test data for my program, I have been asked to do this but I'm not sure how.
#8
Re: Simple Quiz program
Posted 19 January 2007 - 06:07 PM
#9
Re: Simple Quiz program
Posted 13 February 2007 - 12:56 PM
Is there any chance you could show me your code, i have done my array and have started my select case but really stuck thanks laura
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote






|