Modul VB – Latihan Program Ticketing


Buat program menghitung harga tiket dengan ketentuan

Class Price
Economy 100000
Bussines 200000
Executive 300000

Total of Price = Sum of Ticket * Price

Jawaban

Obyek Properti Pengaturan
Form Caption Ticketing
Label1 Caption Sum Of Ticket
Text1 Text (Kosongkan)
Frame1 Caption Class
Option1 Caption Economy
Option2 Caption Bussines
Option3 Caption Executive
Label2 Caption Price
Label3 Caption Total Of Price
Text2 Text (Kosongkan)
Backcolor (Pilih abu-abu)
Text3 Text (Kosongkan)
Backcolor (Pilih abu-abu)
Command1 Caption Ok
Command2 Caption Exit

Private Sub Command1_Click()
  SOT = Val(Text1.Text)
 If Option1.Value Then
   P = 100000
 ElseIf Option2.Value Then
   P = 200000
 Else
   P = 300000
 End If
 TP = SOT * P
 Text2.Text = P
 Text3.Text = TP
End Sub

Private Sub Command2_Click()
  Unload Me
End Sub

2 thoughts on “Modul VB – Latihan Program Ticketing

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