Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim namasiswa As String
Dim Nilaifis, Nilaimat, Nilaibiologi As Single
namasiswa = InputBox(“inputkan nama siswa”, “nama siswa”)
TextBox1.Text = namasiswa
Nilaifis = InputBox(“inputkan nilai fisika”, “nilai fisika”)
TextBox2.Text = Nilaifis
Nilaimat = InputBox(“inputkan nilai matematika”, “nilai matematika”)
TextBox3.Text = Nilaimat
Nilaibiologi = InputBox(“inputkan nilai biologi”, “nilai biologi”)
TextBox4.Text = Nilaibiologi
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = ” ”
TextBox2.Text = ” ”
TextBox3.Text = ” ”
TextBox4.Text = ” ”
TextBox5.Text = ” ”
End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox5.Text = (Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text)) / 3
End Sub
End Class