Jump to content

Pemrograman Visual:Acak Number

From Wiki
Revision as of 13:17, 26 October 2022 by Kangtain (talk | contribs)
private Sub btnAcak 
    txtAngka1.Text = Int(Rnd() + 10)
    txtAngka2.Text = Int(Rnd() + 10)
    lblPesan = ""
end sub

private Sub btnCekHasil
    if Val(txtAngka1.Text) + Val(txtAngka2.Text) = Val(txtHasil.Text) then
        lblPesan.Text = "SELAMAT JAWABAN BENAR..."
    else
        lblPesan.Text = "MAAF, JAWABAN SALAH..."
    end if
end sub

private Sub Form1_Load
    Randomize()
end Sub