Pages

Selasa, 15 Maret 2011

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
Print Friendly and PDF

Artikel Terkait:

0 komentar:

Posting Komentar

Related Posts Plugin for WordPress, Blogger...