• Want to help us with this year's BoS Trials?
    Let us know before 30 June. See this thread for details
  • Looking for HSC notes and resources?
    Check out our Notes & Resources page

Visual Basic 6 (1 Viewer)

Mohit7

Member
Joined
Mar 25, 2006
Messages
35
Gender
Male
HSC
2007
Does anyone know a code that randomizes questions for a quiz.
so it gives 10 questions out of 50.





If anyone in interested in buying a Creative MuVo TX FM 512mb mp3 player reply to this .
 

dddman

Banned
Joined
Jun 13, 2006
Messages
120
Gender
Male
HSC
2005
Randomize(any intger), thats the method from the math class, go and do the rest
 

ianc

physics is phun!
Joined
Nov 7, 2005
Messages
618
Location
on the train commuting to/from UNSW...
Gender
Male
HSC
2006
lowerbound and upperbound are simply the range in which you want the random number to be in

Code:
Randomize
RandomNumber = Int(Rnd * Upperbound) + Lowerbound
To get a set of ten numbers, you simply loop this through

Code:
For counter=0 to 9
Randomize
RandomNumber(counter) = Int(Rnd * Upperbound) + Lowerbound
Next counter
also, you'd have to run a checking algorithm to ensure 2 of the same numbers are not selected

Hope this helps!
 
Last edited:

priesty

formerly wm_abusef
Joined
Jun 23, 2005
Messages
826
Location
so's your face
Gender
Male
HSC
2006
aaaahh, the days of VB.

thank God i don't have to do that ever again.

programming *shudders*
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top