0% found this document useful (0 votes)
28 views12 pages

Laporan2 Variabel New Print

The document is a lab report for a visual programming course. It includes the source code for a VB.NET program that calculates product prices, quantities, discounts, and totals. The code uses IF/THEN/ELSE statements to determine prices based on selected products. Buttons are used to calculate subtotals, apply discounts, and clear fields. Radio buttons set different discount percentages. The report explains the code and provides steps for creating and running the program.

Uploaded by

bagus bryan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views12 pages

Laporan2 Variabel New Print

The document is a lab report for a visual programming course. It includes the source code for a VB.NET program that calculates product prices, quantities, discounts, and totals. The code uses IF/THEN/ELSE statements to determine prices based on selected products. Buttons are used to calculate subtotals, apply discounts, and clear fields. Radio buttons set different discount percentages. The report explains the code and provides steps for creating and running the program.

Uploaded by

bagus bryan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 12

LAPORAN PRAKTIKUM 2

PEMROGRAMAN VISUAL
IF…THEN…ELSE

Oleh:
Annisa
A1317012

Dosen Pengampu:
Herpendi, M.Kom

JURUSAN TEKNIK INFORMATIKA


POLITEKNIK NEGERI TANAH LAUT
2018
Halaman Penilaian Laporan

Uraian Ya/Tidak Keterangan Nilai


Kertas A4

Huruf Times
New Roman size
12

Margin 4-3-3-3
(L-T-R-B)

Materi

Kebenaran
listing untuk
menjawab
permasalahan
Penjelasan
listing

Kesesuaian
listing dengan
hasil running

Total Nilai

2
1. Listing program
Public Class Form1

Private Sub Label3_Click(sender As Object, e As EventArgs) Handles harga.Click

End Sub

Private Sub Label4_Click(sender As Object, e As EventArgs) Handles jumlah.Click

End Sub

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

End Sub

Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles


ComboBox1.SelectedIndexChanged
End Sub

Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles txt_harga.TextChanged


With txt_harga

If ComboBox1.Text = "Krim Pemutih" Then


txt_harga.Text = 200000
ElseIf ComboBox1.Text = "Toner" Then
txt_harga.Text = 75000
ElseIf ComboBox1.Text = "Serum" Then
txt_harga.Text = 150000
ElseIf ComboBox1.Text = "Pelembab" Then
txt_harga.Text = 300000
ElseIf ComboBox1.Text = "Bedak" Then
txt_harga.Text = 150000

End If
End With

End Sub

Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs)

End Sub

Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click


txt_diskon.Text = ""
txt_harga.Text = ""
txt_jum.Text = ""

3
txt_subtot.Text = ""
txt_sub.Text = ""

End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs)


Handles Button1.Click
txt_sub.Text = txt_jum.Text * txt_harga.Text

End Sub

Private Sub Button3_Click(sender As Object, e As EventArgs)


Handles Button3.Click
txt_subtot.Text = Val(txt_sub.Text) - Val(txt_sub.Text) *
((txt_diskon.Text) / 100)

End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs)


Handles Button2.Click
Me.Close()

End Sub

Private Sub Label5_Click(sender As Object, e As EventArgs) Handles


Label5.Click

End Sub

Private Sub Label1_Click(sender As Object, e As EventArgs) Handles


Label1.Click

End Sub

Private Sub TextBox3_TextChanged(sender As Object, e As EventArgs)


Handles txt_sub.TextChanged

End Sub

Private Sub RadioButton1_CheckedChanged_1(sender As Object, e As


EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked Then
txt_diskon.Text = 10
End If
End Sub

Private Sub txt_jum_TextChanged(sender As Object, e As EventArgs)


Handles txt_jum.TextChanged

End Sub

Private Sub RadioButton4_CheckedChanged(sender As Object, e As


EventArgs) Handles RadioButton4.CheckedChanged
If RadioButton2.Checked Then
txt_diskon.Text = 20
End If
End Sub

Private Sub RadioButton3_CheckedChanged(sender As Object, e As

4
EventArgs) Handles RadioButton3.CheckedChanged
If RadioButton3.Checked Then
txt_diskon.Text = 30
End If
End Sub

Private Sub RadioButton2_CheckedChanged(sender As Object, e As


EventArgs) Handles RadioButton2.CheckedChanged
If RadioButton4.Checked Then
txt_diskon.Text = 40
End If
End Sub

Private Sub RadioButton5_CheckedChanged(sender As Object, e As


EventArgs) Handles RadioButton5.CheckedChanged
If RadioButton5.Checked Then
txt_diskon.Text = 0
End If
End Sub

Private Sub TextBox4_TextChanged(sender As Object, e As EventArgs)


Handles txt_subtot.TextChanged

End Sub

Private Sub txt_diskon_TextChanged(sender As Object, e As


EventArgs) Handles txt_diskon.TextChanged

End Sub
End Class

2. Proses

3. Hasil Running

5
4. Penjelasan
Listing Penjelasan
With txt_harga Artinya apabila combobox memilih
If ComboBox1.Text = salah satu barang yang tersedia di
"Krim Pemutih" Then dalam combobox maka harga nya
txt_harga.Text = akan keluar sesuai dengan yang telah
200000
ElseIf ComboBox1.Text = di tentukan di dalam coding contohnya
"Toner" Then Jika combobox1 pilhannya krim
txt_harga.Text =
75000
pemutih jadi harga dari krim
ElseIf ComboBox1.Text = pembersih akan keluar = 200000
"Serum" Then begitu juga seterusnya
txt_harga.Text =
150000
ElseIf ComboBox1.Text =
"Pelembab" Then
txt_harga.Text =
300000
ElseIf ComboBox1.Text =
"Bedak" Then
txt_harga.Text =
150000

txt_diskon.Text = "" Rumus ini digunakan untuk


txt_harga.Text = ""
txt_jum.Text = "" mengosongkan ini dari diskon, harga,

6
txt_subtot.Text = "" jumlah,subtotal,dan sub perintah clear
txt_sub.Text = ""
apabila button clear di klik maka
semua tebel akan kosong
txt_sub.Text = txt_jum.Text Rumus ini di gunakan untuk
* txt_harga.Text
menghitung harga barang dikaikan
dengan jumlah
Me.Close() Di gunakan untuk menutup program
txt_subtot.Text = Val(txt_sub.Text) Rumus ini digunakan untuk
- Val(txt_sub.Text) *
((txt_diskon.Text) / 100) menentukan total pembayaran subtotal
di kurang subtotal dikali diskon dibagi
100
Private Sub Artinya jika radiobutton1 di pilah
RadioButton1_CheckedChanged_1(sender
As Object, e As EventArgs) Handles maka diskon akan keluar 10 % begitu
RadioButton1.CheckedChanged juga dengan radiobutton lainnya
If RadioButton1.Checked Then
txt_diskon.Text = 10
End If
End Sub

Private Sub
txt_jum_TextChanged(sender As
Object, e As EventArgs) Handles
txt_jum.TextChanged

End Sub

Private Sub
RadioButton4_CheckedChanged(sender
As Object, e As EventArgs) Handles
RadioButton4.CheckedChanged
If RadioButton2.Checked Then
txt_diskon.Text = 20
End If
End Sub

Private Sub
RadioButton3_CheckedChanged(sender
As Object, e As EventArgs) Handles
RadioButton3.CheckedChanged
If RadioButton3.Checked Then
txt_diskon.Text = 30
End If
End Sub

Private Sub
RadioButton2_CheckedChanged(sender
As Object, e As EventArgs) Handles
RadioButton2.CheckedChanged
If RadioButton4.Checked Then
txt_diskon.Text = 40

Private Sub
RadioButton5_CheckedChanged(sender
As Object, e As EventArgs) Handles
RadioButton5.CheckedChanged

7
If RadioButton5.Checked Then
txt_diskon.Text = 0
End If
End Sub

Private Sub
TextBox4_TextChanged(sender As
Object, e As EventArgs) Handles
txt_subtot.TextChanged

1. Buat new project untuk membuat project baru

8
2. Kemudian pilih desktopnya beri nama dekstopnya

3. Akan keluar form kemudian isi form tersebut atau desain sesuai keinginan

4. Toolboxt yang di gunakan label,textboxt,button, combobox dan Radio button

9
5. Untuk mengganti backround klik form kemudian properties backroundlm
seperti di bawah ini

6. Pilih gambar yang ingin di jadikan backround klik Ok

10
7. Tampillah desain seperti di bawah ini

8. Nama akan dikalikan jumlah kemudian muncul harga kemudian klik sub_total
akan keluar hasil keseluruhan kemudian tentukan diskon yang akan di berikan

11
setelah itu akan keluar hasil total jika ingin menghitung lagi klik clear untuk
membersihkan perhitungan dan jika selesai maka klik exit maka program akan
keluar .

12

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy