Visual Basic 2010 express answer program?
I have made a random number generator. It generates one random number from 0 to 3. How can i make it so if it generates 0 instead of 0 is says "Yes" for example? Thank you in advance!
I have made a random number generator. It generates one random number from 0 to 3. How can i make it so if it generates 0 instead of 0 is says "Yes" for example? Thank you in advance!
Comments
Try this
Dim Rnd as New Random
Dim Num As Integer
Num=Rnd.Next(0,4)
If Num=0 then
MsgBox("Yes")
ElseIf Num=1 Then
MsgBox("No")
ElseIf Num=2 Then
MsgBox("Maybe")
Else
MsgBox("Doubtful")
End If
TexMav
Your code became purely high quality and did no longer prefer revision. the only errors you made became in misspelling considered one of your variables. particularly of writing "ObjItem" you wrote "ObjItems" interior your Console.WriteLine() call interior the loop. purely do away with the 's' and it relatively works o.k.. And it is your CODE, too. in undemanding terms a typo. the errors message you purchased with regard to the lacking purpose became considering the fact which you had by no capability efficiently compiled the undertaking. So there became no earlier version floating approximately. You had errors to restoration, hadn't fastened them, by no capability had a working version earlier, and so which you purchased the message approximately utilising an older version and then once you reported "circulate forward and seek for an older one" you purchased yet another message approximately failing to locate that. All regularly occurring stuff. you in undemanding terms made ONE, SMALL mistake. And all of us make those varieties of errors.