Posted by : Rhyf Ahmad
Thursday, December 27, 2012
Hmmmm,, udah lama iah gag posting masalah Visual Basic, masih karena kesibukan, boro-boro ngurusin Visual Basic, makan aja sering telat sob, ckckckck...
Ya udah deh, postingan yang super imut ini akan membahas tentang operasi Matematik di Visual Basic .Net, yang tentunya bagi Sobat Blogger yang masih belajar Visual Basic seperti saiia. Yok ah disimak.. ;)
Tutorial kali ini jangan yang susah-susah dulu iah sob, penambahan, pengurangan, perkalian, pembagian dan bilangan exponen aja dulu, nih caranya kayak begini nih sob.
Perlu diketahui terlebih dahulu, menggunakan tutorial ini disarankan menggunakan 3 buah TextBox dan 1 buah Button.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim num1, num2, sum As Single
num1 = TextBox1.Text
num2 = TextBox2.Text
sum = num1+num2
TextBox3.Text = sum
End Sub
Perkalian
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim num1, num2, product As Single
num1 = TextBox1.Text
num2 = TextBox2.Text
product = num1*num2
TextBox3.Text = product
End Sub
Pengurangan
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim num1, num2, difference As Single
num1 = TextBox1.Text
num2 = TextBox2.Text
difference = num1-num2
TextBox3.Text = difference
End Sub
Pembagian
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles Button1.Click
Dim num1, num2, quotient As Single
num1 = TextBox1.Text
num2 = TextBox2.Text
quotient = num1/num2
TextBox3.Text = quotient
End Sub
Nah Sobat Blogger, cukup lah untuk saat ini, nanti gampang dilanjut di posting berikutnya,,
Oceh???
Related Posts :
- Back to Home »
- Programming , Visual Basic »
- Operasi Matematik di Visual Basic .Net