0% found this document useful (0 votes)
15 views6 pages

Praktikum Aida Widi Astuti

The document contains code for two forms in a Visual Programming practical assignment. The first form calculates a result based on user input values, while the second form manages a sales transaction, including payment validation and discount calculations based on quantity purchased. It also includes functionality for clearing inputs and exiting the application.

Uploaded by

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

Praktikum Aida Widi Astuti

The document contains code for two forms in a Visual Programming practical assignment. The first form calculates a result based on user input values, while the second form manages a sales transaction, including payment validation and discount calculations based on quantity purchased. It also includes functionality for clearing inputs and exiting the application.

Uploaded by

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

Nama: Aida Widi Astuti

Nim: A3.2100005
Sistem Informasi 4-B
Pemrograman Visual
Praktikum 3
 mengalikan hasil bilangan
Desain

Kode
Public Class Form1
Private Sub btnproses_Click(sender As Object, e As EventArgs) Handles btnproses.Click
Dim nilai1 As Integer
Dim nilai2 As Integer
Dim nilai3 As Integer
Dim hasil As Integer

nilai1 = txtnilai1.Text
nilai2 = txtnilai2.Text
nilai3 = txtnilai3.Text

hasil = (nilai1 + nilai2) * nilai3


txthasil.Text = hasil

End Sub
End Class

Hasil

 PENJUALAN BARANG
Desain

Kode
Public Class Form2
Dim Total_bayar As Double
Dim kembali As Double

Private Sub btnsimpan_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnsimpan.Click
If txtbayar.Text < txttotalbayar.Text Then
MessageBox.Show("Pembayaran kurang mohon periksa kembali",
"Information", MessageBoxButtons.OK,
MessageBoxIcon.Information)
Else
MessageBox.Show("Data tersimpan, cetak faktur?", "Information",
MessageBoxButtons.YesNo,
MessageBoxIcon.Information)
End If
End Sub

Private Sub txtjumlahbeli_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles txtjumlahbeli.TextChanged
On Error Resume Next
Total_bayar = Val(txtharga.Text) * Val(txtjumlahbeli.Text)
txttotalbayar.Text = Total_bayar
If txtjumlahbeli.Text < 5 Then
txtdiskon.Text = 0
txtrp.Text = (0 * Total_bayar) / 100
ElseIf txtjumlahbeli.Text >= 5 And txtjumlahbeli.Text >= 9 Then
txtdiskon.Text = 5
txtrp.Text = (5 * Total_bayar) / 100
ElseIf txtjumlahbeli.Text >= 10 And txtjumlahbeli.Text >= 14 Then
txtdiskon.Text = 10
txtrp.Text = (10 * Total_bayar) / 100
ElseIf txtjumlahbeli.Text >= 15 Then
txtdiskon.Text = 15
txtrp.Text = (15 * Total_bayar) / 100
Else
txtdiskon.Text = ""
MessageBox.Show("Anda salah memasukan jumlah beli", "poesan",
MessageBoxButtons.OK,
MessageBoxIcon.Error)
End If
txttotalbayar.Text = Total_bayar - txtrp.Text
End Sub
Private Sub txtbayar_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtbayar.TextChanged
kembali = Val(txtbayar.Text) - Val(txttotalbayar.Text)
txtkembali.Text = kembali
End Sub

Private Sub btnclear_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnclear.Click
txtnofaktur.Text = ""
txtnamapelanggan.Text = ""
cbnamabarang.Text = ""
txtharga.Text = ""
txtjumlahbeli.Text = ""
txtbayar.Text = ""
txttotalbayar.Text = ""
txtkembali.Text = ""
End Sub

Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles btnexit.Click
End
End Sub
End Class
Hasil

You might also like