div.TabView div.Tabs { height: 24px; overflow: hidden; } div.TabView div.Tabs a { float: left; display: block; width: 90px; text-align: center; height: 24px; padding-top: 3px; vertical-align: middle; border: 1px solid #000; border-bottom-width: 0; text-decoration: none; font-family: "Times New Roman", Serif; font-weight: 900; color: #000; } div.TabView div.Tabs a:hover, div.TabView div.Tabs a.Active { background-color: #FF9900; } div.TabView div.Pages { clear: both; border: 1px solid #6E6E6E; overflow: hidden; background-color: #FF9900; } div.TabView div.Pages div.Page { height: 100%; padding: 0px; overflow: hidden; } div.TabView div.Pages div.Page div.Pad { padding: 3px 5px; }

Pages

Subscribe:

Recent Post

Popular Post

TG

Sample Text

Minggu, 02 Oktober 2011

Contoh Pemrograman


 Contoh program sederhana dalam bahasa Visual Basic .NET yang dipakai untuk menghitung jumlah pembayaran dari m_item buah barang dengan harga m_price per item ditambah 5% pajak penjualan: 
Dim m_item, m_price, tax, total As double
  m_item = double.Parse(textBox1.Text)
  m_price = double.Parse(textBox2.Text)
  tax = 0.05
  total = m_item * m_price * (1 + tax)
  label5.Text = total.ToString()
  MessageBox.Show("Well Done.")
Berikut ini adalah contoh lain dari program Visual Basic yang menggunakan objek CheckBox dan ComboBox untuk menghitung jumlah kredit mata kuliah yang diambil oleh seorang mahasiswa (masing-masing mata kuliah = 3 kredit):
Dim total As Integer
total = 0 ' awal dari jumlah kredit total
If (CheckBox1.Checked = True) Then 'boleh memilih semua checkbox
            total += 3
        End If
        If (CheckBox2.Checked = True) Then
            total = total + 3
        End If
        If (CheckBox3.Checked = True) Then
            total = total + 3
        End If
If (ComboBox1.SelectedIndex = 0) Then 'hanya bisa memilih satu
            total = total + 3
        ElseIf (ComboBox1.SelectedIndex = 1) Then
            total = total + 3
        ElseIf (ComboBox1.SelectedIndex = 2) Then
            total = total + 3 
        End If
Label3.Text = CStr(total) ' hasil kredit total yang diambil



0 komentar: