Hi I have hard time connecting the if else statement because my teacher is telling us to use this kind of if else
if (statement)
if (statement)
if (statement)
condition
else
condition("error")
end if
else
condition
end if
else
condition
end if
this is a simple betting game can you please tell me how to arrange this code i really have hard time doing this in this way and there slight problems in this code
If (Val(txtInput.Text) >= 0 And Val(txtInput.Text) <= 9 And IsNumeric(txtInput.Text)) Then
lblRandom.Text = Int(Rnd() * 10)
Else
MessageBox.Show("Wrong Input!", Me.Text, MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
SendKeys.Send("{Home}+{End}")
txtInput.Focus()
End If
If (Val(txtInput.Text) > Val(lblRandom.Text)) Then
lblOutput.Text = "You Win!"
End If
If (Val(txtInput.Text) < Val(lblRandom.Text)) Then
lblOutput.Text = "You Lose!"
End If
If (txtInput.Text = lblRandom.Text) Then
lblOutput.Text = "Draw!"
End If