Program Code for Times Table

Change the program code below so that the program performs the calculation in a separate procedure from the display.

Option Explicit
Private Sub CmdStart_Click()
'Set up variables
Dim multiple As Integer
'Get Multiplier from user
Call GetValue(multiple)
'Display table
Call DisplayTable(multiple)
End Sub


Private Sub GetValue(ByRef intvalue As Integer)
intvalue = InputBox("Please enter the value")
End Sub


Private Sub DisplayTable(ByVal multiple)
Dim Counter As Integer
Dim Answer As Integer
For Counter = 1 To 12
Answer = multiple * Counter
lstOutput.AddItem multiple & " X " & Counter & " = " & Answer
Next
End Sub