Halo hai-hai kembali :D
Kali ini saya akan membagikan kodingan singkat untuk menghitung biaya total (uang makan, uang laptop, uang asrama dan uang spp)
Semoga bisa berguna buat teman-teman yaa
Public Class Bulanan
Private lptp, spp, mkn, asrm As Double
Property laptop As Double
Get
Return lptp
End Get
Set(value As Double)
lptp = value
End Set
End Property
Property biayaspp As Double
Get
Return spp
End Get
Set(value As Double)
spp = value
End Set
End Property
Property makan As Double
Get
Return mkn
End Get
Set(value As Double)
mkn = value
End Set
End Property
Property asrama As Double
Get
Return asrm
End Get
Set(value As Double)
asrm = value
End Set
End Property
Public Function total() As Double
Return (laptop * 600000) + (biayaspp * 4000000) + (makan * 650000) + (asrama * 250000)
End Function
End Class
Module Module1
Sub Main()
Dim data As New Bulanan
Console.WriteLine("Berapa bulan anda ingin membayar uang makan :")
data.makan = Console.ReadLine
Console.WriteLine("Berapa semester anda ingin membayar uang spp:")
data.biayaspp = Console.ReadLine
Console.WriteLine("Berapa bulan anda ingin membayar uang laptop")
data.laptop = Console.ReadLine
Console.Write("Berapa bulan anda ingin membayar uang asrama:")
data.asrama = Console.ReadLine
Console.WriteLine("Total pembayaran anda :{0}", data.total)
Console.ReadLine()
End Sub
End Module
Tidak ada komentar:
Posting Komentar