January 20th, 2013, 02:37 PM
How to pick a random number from given set of numbers
Hello everyone. I am in a last year of gymnasium and I really enjoy working with computers. Specialy while programming. I am a beginner (started few weeks ago) and I actually made my first mathematical program but with no random number generator, and just 10 expressions. After formatting my computer my first program was lost so I decided to make a new one with some improvments involved. With a help from a friend (which brought me into VB and tought me how VB actually works, but this is all I know) I made form for summating, form for subduction and form for multiplication. Now I am stuck at from for dividing.
My idea is to make something like this:
Program auto-generates number from 1-10 and puts it into label2. Then with a statments program randomly chooses one number from given set of numbers and puts it into label2.
//Program generates number 5, so label2.text = "5"
If label2.text = "5" Then label1.text = [Solution] (So label1.text should be 5, 10, 15, 20, 25, 30, 35, 40, 45 or 50.)
I already tried http://www.dreamincode.net/forums/to...set-of-number/ but this works just for 1 divisor (out of ten). So what to do? Oh, btw please explain your solution as you would explain it to the total beginner, someone who doesn't have a clue what VB is
Thanks to all of you and have a nice day.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!