Pemrograman Visual:Acak Number: Difference between revisions
Appearance
No edit summary |
m Kangtain moved page Materi/Pemrograman Visual/Acak Number to Pemrograman Visual:Acak Number |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
[[File:Acak number 1.png|center|thumb]] | [[File:Acak number 1.png|center|thumb]] | ||
* Seluruh kode program | * Seluruh kode program | ||
<syntaxhighlight lang="vb.net" line="1"> | <syntaxhighlight lang="vb.net" line="1"> | ||
Public Class Form1 | Public Class Form1 | ||
| Line 25: | Line 27: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
[[Category:Materi]] | [[Category:Materi]] | ||
[[Category:Matkul]] | [[Category:Matkul]] | ||
[[Category:Pemrograman]] | [[Category:Pemrograman]] | ||
[[Category:Pemrograman Visual]] | [[Category:Pemrograman Visual]] | ||
Latest revision as of 11:23, 23 November 2022
- Desain Program

- Seluruh kode program
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAcak.Click
txtAngka1.Text = Int(Rnd() * 10)
txtAngka2.Text = Int(Rnd() * 10)
End Sub
Private Sub btnCekHasil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCekHasil.Click
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(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Randomize()
End Sub
End Class