SHARE
TWEET

Untitled

a guest Mar 20th, 2017 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Strict Off
  2.  
  3. Public Class Lottery
  4.  
  5.     Dim randomObject As New Random()
  6.     Dim randomNumber As Integer
  7.  
  8.     Private Sub genButton_Click(sender As Object, e As EventArgs) Handles genButton.Click
  9.  
  10.         Dim pick3 As Integer = PickThree()
  11.         Dim pick4 As Integer = Pickfour()
  12.         Dim pick5 As Integer = PickFive()
  13.         Dim pick5Add As Integer = PickFiveAdd()
  14.         Dim pickAddi As Integer = PickBonus()
  15.  
  16.         pickThreeRes.Text = String.Format(pick3)
  17.         pickFourRes.Text = String.Format(pick4)
  18.         pickFiveRes.Text = String.Format(pick5)
  19.         pickFiveAddRes.Text = String.Format(pick5Add)
  20.         pickAdd.Text = String.Format(pickAddi)
  21.  
  22.     End Sub
  23.  
  24.     Function PickThree() As Integer
  25.  
  26.         For i = 1 To 3
  27.             randomNumber = (randomObject.Next(0, 10))
  28.         Next
  29.  
  30.         Return randomNumber
  31.     End Function
  32.  
  33.     Function Pickfour() As Integer
  34.  
  35.         Dim randomObject As New Random()
  36.  
  37.         For i = 1 To 4
  38.             randomNumber = (randomObject.Next(0, 10))
  39.         Next
  40.  
  41.         Return randomNumber
  42.     End Function
  43.  
  44.     Function PickFive() As Integer
  45.  
  46.         Dim randomObject As New Random()
  47.  
  48.  
  49.         For i = 1 To 5
  50.             randomNumber = (randomObject.Next(1, 40))
  51.         Next
  52.  
  53.         Return randomNumber
  54.     End Function
  55.  
  56.     Function PickFiveAdd() As Integer
  57.  
  58.         Dim randomObject As New Random()
  59.  
  60.  
  61.         For i = 1 To 5
  62.             randomNumber = (randomObject.Next(1, 50))
  63.         Next
  64.  
  65.         Return randomNumber
  66.     End Function
  67.  
  68.     Function PickBonus() As Integer
  69.  
  70.         Dim randomObject As New Random()
  71.  
  72.  
  73.         For i = 1 To 1
  74.             randomNumber = (randomObject.Next(1, 43))
  75.         Next
  76.  
  77.         Return randomNumber
  78.     End Function
  79. End Class
RAW Paste Data
Top