0% found this document useful (0 votes)
37 views2 pages

Nama: Reza Rio Avrilian Kelas: Reguler B Pagi: Coding

The document contains code for a form with text boxes and buttons that perform basic math operations like addition, subtraction, multiplication, division, and modulus on the values in two text boxes and display the result in a third text box.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views2 pages

Nama: Reza Rio Avrilian Kelas: Reguler B Pagi: Coding

The document contains code for a form with text boxes and buttons that perform basic math operations like addition, subtraction, multiplication, division, and modulus on the values in two text boxes and display the result in a third text box.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Nama : Reza Rio Avrilian

Kelas : Reguler B pagi

Coding
Public Class Form2

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
Dim cek = Val(TextBox1.Text) + Val(TextBox2.Text)
TextBox3.Text = FormatNumber(cek, 0)
End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button5.Click
Dim cek = Val(TextBox1.Text) - Val(TextBox2.Text)
TextBox3.Text = FormatNumber(cek, 0)
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
Dim cek = Val(TextBox1.Text) * Val(TextBox2.Text)
TextBox3.Text = FormatNumber(cek, 0)
End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button6.Click
Dim cek = Val(TextBox1.Text) Mod Val(TextBox2.Text)
TextBox3.Text = FormatNumber(cek, 0)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
Dim cek = Val(TextBox1.Text) / Val(TextBox2.Text)
TextBox3.Text = FormatNumber(cek, 0)
End Sub

Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button7.Click
Dim cek = Val(TextBox1.Text)
TextBox3.Text = FormatNumber(Math.Sqrt(cek), 0)
End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button8.Click
Dim cek = Val(TextBox1.Text) / Val(TextBox2.Text)
TextBox3.Text = FormatNumber(cek)
End Sub
End Class

You might also like