The following short program demonstrates a number of fundamental programming techniques that you will probably need when attempting to complete homework assignments.
This isn't the answer to your homework assignment, but if you don't understand this program then you won't get far.
Public Class Form1
Private ableToProgram As Boolean = False
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
Dim grade As String
Dim decision As String
While Not ableToProgram
decision = InputBox("Do you want to cheat? (Y/N)", _
"Learn to Program", "Y")
If decision.ToUpper = "Y" Then
grade = PostAssignmentOnForums()
Else
grade = DoWorkYourself()
End If
MsgBox(String.Format("You got an {0}", grade))
End While
MsgBox("Good Choice!")
End Sub
Function PostAssignmentOnForums() As String
ableToProgram = False
Return "F"
End Function
Function DoWorkYourself() As String
ableToProgram = True
Return "A"
End Function
End Class