Skip to content

Jawaban Soal 3 (Rahima)

Januari 29, 2012

Kasus :http://mesran.wordpress.com/2012/01/26/kasus-program-tagihan-pdam/

Program :

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub
Sub Cek()
Dim x As String

x = Microsoft.VisualBasic.Mid(Kd_Pelanggan.Text, 5, 3)
If x = “MED” Then
DAERAH.Text = “Medan”
ElseIf x = “BEL” Then
DAERAH.Text = “Belawan”
ElseIf x = “TEM” Then
DAERAH.Text = “Aksara”
ElseIf x = (“MAR”) Then
DAERAH.Text = “Marendal”
ElseIf x = “BIN” Then
DAERAH.Text = “Binje”
ElseIf x = “PAK” Then
DAERAH.Text = “Pakam”
Else
DAERAH.Text = “”
End If

x = Microsoft.VisualBasic.Left(Kd_Pelanggan.Text, 3)
If x = “TOK” Then
Type_Pelanggan.Text = “TOKO”
BIAYA.Text = 25000
HARGA.Text = 300
ElseIf x = “RUM” Then
Type_Pelanggan.Text = “RUMAH”
BIAYA.Text = 15000
HARGA.Text = 100
ElseIf x = “SWA” Then
Type_Pelanggan.Text = “SWALAYAN”
BIAYA.Text = 10000
HARGA.Text = 200
ElseIf x = “PAB” Then
Type_Pelanggan.Text = “PABRIK”
BIAYA.Text = 250000
HARGA.Text = 500
Else
Type_Pelanggan.Text = “0”
BIAYA.Text = “0”
HARGA.Text = “0”
End If

No_Urt.Text = Microsoft.VisualBasic.Right(Kd_Pelanggan.Text, 3)
End Sub
Sub totalBayar()
PAJAK.Text = 0.01 * Val(Ttl_Tagihan.Text)
Ttl_Bayar.Text = Val(Ttl_Tagihan.Text) + Val(PAJAK.Text)
End Sub
Private Sub BtnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_proses.Click
Call Cek()
Call Bayar()
Call totalBayar()
End Sub

Sub Bayar()
Ttl_Tagihan.Text = Val(BIAYA.Text) + (Val(PEMAKAIAN.Text) * Val(HARGA.Text))
End Sub

Private Sub BtnKeluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn_Keluar.Click
End
End Sub
End Class

HAsilnya :

From → Uncategorized

Tinggalkan sebuah Komentar

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: