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 Nilaimat, Nilaiipa, Nilaibahasaindonesia, Nilaibahasainggris As Single
namasiswa = InputBox(“inputkan nama siswa”, “nama siswa”)
TextBox1.Text = namasiswa
Nilaimat = InputBox(“inputkan nilai matematika”, “nilai matematika”)
TextBox2.Text = Nilaimat
Nilaiipa = InputBox(“inputkan nilai ipa”, “nilai ipa”)
TextBox3.Text = Nilaiipa
Nilaibahasaindonesia = InputBox(“inputkan nilai bahasa indonesia”, “nilai bahasa indonesia”)
TextBox4.Text = Nilaibahasaindonesia
Nilaibahasainggris = InputBox(“inputkan nilai bahasa inggris”, “nilai bahasa inggris”)
TextBox5.Text = Nilaibahasainggris
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 = ” ”
TextBox6.Text = ” ”
TextBox7.Text = ” ”
End Sub

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

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox7.Text = (Val(TextBox2.Text) + Val(TextBox3.Text) + Val(TextBox4.Text) + Val(TextBox5.Text))
End Sub
End Class