Tutorial Programming

Tutorial basic, Visual Studio VB.NET 2013 Pengunaan Function Class OOP(Object Oriented Programming)


Hallo sahabat saya akan menjelaskan Pengunaan Function Class OOP(Object Oriented Programming) pada visual studio 2013, oke langsung aja


1.Buatlah Class1


Public Class MyClass1
Public Function BMI(ByVal height As Single, ByVal weight As Single)
BMI = Format((weight) / (height ^ 2), “0.00”)
End Function
End Class



2.Isi coding ini pada Form1



Private Sub BtnBMI_Click(sender As Object, e As EventArgs) Handles BtnBMI.Click
Dim MyObject As Object
Dim h, w As Single
MyObject = New MyClass1()
h = InputBox(“What is your height in meter”)
w = InputBox(“What is your weight in kg”)
MessageBox.Show(MyObject.BMI(h, w))
End Sub




Sekian tutorial saya sahabat semoga bermanfaat yah.

No comments:

Post a Comment

Tutorial Programming Designed by Templateism | Ary EJFA Copyright © 2015

Theme images by richcano. Powered by Blogger.