Write a program to play a lottery game. The player will select 3 numbers between 1 and 9; these
numbers do not have to be unique. For example, the player may select 3, 2, 9 or 6, 2, 2. The winning
numbers are randomly generated by the computer. If all three of the numbers selected by the player are
the same as the winning numbers generated, then the player wins, otherwise the player loses. The
player’s numbers and the winning numbers must be an exact match (the order the numbers appear must
match).
And so far I have:
Dim num1 As Integer
Dim num2 As Integer
Dim num3 As Integer
num1 = txtnum1.Text
num2 = txtnum2.Text
num3 = txtnum3.Text
num1 = CInt(txtnum2.Text)
num2 = CInt(txtnum2.Text)
num3 = CInt(txtnum3.Text)
Dim randomNum As New Random 'creates a random number generator
Dim winningNum1 As Integer
winningNum1 = randomNum.Next(1, 9)
Dim winningNum2 As Integer
winningNum2 = randomNum.Next(1, 9)
Dim WinningNum3 As Integer
WinningNum3 = randomNum.Next(1, 9)
I am having difficulties converting the numbers to string. Also making a textbox visible after the button has been clicked. Please help
This post has been edited by modi123_1: 05 December 2010 - 11:45 AM
Reason for edit:: please use the code tags..

New Topic/Question
Reply




MultiQuote




|