9
UTS Pemrograman Visual Oleh : I Gst. Md. Ngurah Bimantara (1304405022) JURUSAN TEKNIK ELEKTRO FAKULTAS TEKNIK UNIVERSITAS UDAYANA BUKIT-JIMBARAN

Uts

Embed Size (px)

Citation preview

UTS Pemrograman Visual

Oleh :I Gst. Md. Ngurah Bimantara(1304405022)

JURUSAN TEKNIK ELEKTROFAKULTAS TEKNIK UNIVERSITAS UDAYANABUKIT-JIMBARAN2014

1. Aplikasi untuk menghitung luas dan volume dari suatu bangunan:

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Form2.Show() End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Form3.Show() End SubEnd Class

a. Trapesium

Public Class Form2

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click txtluas.Text = 1 / 2 * (txtsisisejajar.Text) * txttinggi.Text End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Close() End Sub

Private Sub txtsisisejajar_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtsisisejajar.TextChanged

End SubEnd Class

b. Volume dari kubus dimana didalam terdapat tabung dengan nilai masing- masing variable dapat diinput melalui aplikasi

Public Class Form3

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Close() End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click txtluaskubus.Text = txtsisikubus.Text ^ 2 * 6 txtvolume.Text = (txtsisikubus.Text ^ 3) - 3.14 * txtjari.Text ^ 2 * txttinggitabung.Text End Sub

Private Sub txtluaskubus_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtluaskubus.TextChanged

End SubEnd Class

Gambar 1 tampilan aplikasi penghitung luas dan volume

2. Aplikasi konversi suhu Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Form2.Show() End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Form3.Show() End SubEnd Class

Public Class Form2

Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click Close() End Sub

Private Sub btnhitung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhitung.Click txtfahrenheit.Text = 1.8 * txtcelcius.Text + 32 End Sub

Private Sub txtcelcius_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtcelcius.TextChanged

End SubEnd Class

Public Class Form3

Private Sub btnhitung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhitung.Click txtreamur.Text = txtcelcius.Text * 0.8 End Sub

Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click Close() End Sub

Private Sub txtreamur_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtreamur.TextChanged

End Sub

Private Sub txtcelcius_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtcelcius.TextChanged

End SubEnd Class

Gambar 2 tampilan aplikasi konversi suhu

3. Aplikasi untuk menghitung transaksi penjualan produkPublic Class Form1

Private Sub btnhitung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhitung.Click txttotalbayar.Text = (txtharga.Text * txtjumlah.Text) - txtpromo.Text txtkembali.Text = txtbayar.Text - txttotalbayar.Text End Sub

Private Sub txtkode_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtkode.TextChanged

End SubEnd Class

Gambar 3 tampilan aplikasi untuk menghitung transaksi penjualan produk