请求电脑高手的帮忙
有哪位电脑高手会编程的您告诉我怎样用Visual Basic 6.0 的语言编一下以下的程序.
Lotto Program (using arrays)
Project name Lotto649
Lotto 6-49 is one of a type of lottery games popular in North America. Six numbers are drawn from a big machine which contains 49 different numbered balls( ie. numbered from 1 to 49 ). When buying a ticket ( $1.00), the player picks 6 different numbers or buys a "Quick Pick" where the computer picks the six numbers for them. The draw is held once or twice a week. The prize breakdown is something like this:
6 numbers - $2 600 000 - 10 000 000 (depends on who won)
5 numbers - $10 000
4 numbers - $100
3 numbers - $10
( nothing for 2 or 1 matching numbers)
Of course, the odds of winning are pretty infinitesimal. (see note)
Write a program that will
-allow the user to enter in 6 numbers or "Quick Pick"
-generate a continuous stream of draw tickets until the user realizes how futile the game is or a few hundred million games have been played
-count the number of tickets drawn and the cost of the tickets
-counts the number of winning tickets ( tickets drawn that match 3,4,5 or 6 numbers on the player’s ticket) and displays the results
-keeps a running total of how the user is doing financially
Sample output:
After 50000 tickets
43800 zero number matches (88%)
6122 one number matches (12%)
75 two number matches ( 0.16%)
2 three number matches ( 0.004%)
0 four number matches ( 0%)
0 five number matches ( 0%)
1 six number match ( 0.002%)
total cost $ 50 000.00
total winnings $1 000 020.00
your final balance $ 950 020.00
note
The odds of actually winning the 6 number match are effectively the same whether you buy a ticket or not. If the probability of getting one of your numbers is 1/49, then the probability of getting the next is 1/48 and so on... The probability of getting all the numbers is the product of all the probabilities
i.e. 6/49 x 5/48 x 4/47 x 3/46 x 4/45 x 3/44 x 2/43 x 1/42 = a very small number