0% found this document useful (0 votes)
49 views4 pages

Quis Pertemuan 4: 1. Pertama Buka Aplikasi Buka Aplikasi Visual Studio

This document describes the steps to create a Visual Basic application for calculating profit from sales of various items. It includes: 1. Opening Visual Studio and designing the application interface. 2. Adding labels, textboxes, and buttons and setting their properties. 3. Writing code to clear fields when a button is clicked, populate a dropdown list, display a message when another button is clicked to exit, and calculate costs, sales prices, and profits when an item is selected. 4. The application calculates costs, sales prices with markups, and profits for various items like flour, rice, instant noodles, cigarettes, and milk.
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)
49 views4 pages

Quis Pertemuan 4: 1. Pertama Buka Aplikasi Buka Aplikasi Visual Studio

This document describes the steps to create a Visual Basic application for calculating profit from sales of various items. It includes: 1. Opening Visual Studio and designing the application interface. 2. Adding labels, textboxes, and buttons and setting their properties. 3. Writing code to clear fields when a button is clicked, populate a dropdown list, display a message when another button is clicked to exit, and calculate costs, sales prices, and profits when an item is selected. 4. The application calculates costs, sales prices with markups, and profits for various items like flour, rice, instant noodles, cigarettes, and milk.
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/ 4

Nama : Asep Anwar Sanusi

NPM : 19402111

Kelas : SI-XW41/19

Quis Pertemuan 4
1. Pertama buka aplikasi Buka aplikasi Visual Studio

2. Lalu buat desain seperti dibawah ini

3. Properties
Label1 lb_nama
Label2 lb_jual
Label3 lb_beli
Label4 lb_laba
Label5 Banner
Label6 Banner
Label7 Banner
Textbox1 txt_npm
Textbox2 txt_nama
Textbox3 txt_jurusan
ComboBox cb_barang
Button1 btn_del
Button2 btn_exit

4. Koding

Public Class Form1

Private Sub Btn_del_Click(sender As Object, e As EventArgs) Handles Btn_del.Click


cb_barang.Text = ""
txt_beli.Text = ""
txt_jual.Text = ""
txt_laba.Text = ""
End Sub

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


cb_barang.Items.Clear()
cb_barang.Items.Add("Terigu")
cb_barang.Items.Add("Beras")
cb_barang.Items.Add("Mi Instan")
cb_barang.Items.Add("Rokok")
cb_barang.Items.Add("Susu")
End Sub

Private Sub Btn_exit_Click(sender As Object, e As EventArgs) Handles Btn_exit.Click


Btn_exit.Text = MsgBox("Anda Ingin Keluar Aplikasi ?", vbQuestion + vbOKCancel,
"Info")
If Btn_exit.Text = vbOK Then
End
End If
End Sub

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


cb_barang.SelectedIndexChanged
If cb_barang.SelectedIndex = 0 Then
txt_beli.Text = 10000
txt_jual.Text = Val(txt_beli.Text) + Val(txt_beli.Text * 0.05)
txt_laba.Text = Val(txt_jual.Text) - Val(txt_beli.Text)
ElseIf cb_barang.SelectedIndex = 1 Then
txt_beli.Text = 50000
txt_jual.Text = Val(txt_beli.Text) + Val(txt_beli.Text * 0.1)
txt_laba.Text = Val(txt_jual.Text) - Val(txt_beli.Text)
ElseIf cb_barang.SelectedIndex = 2 Then
txt_beli.Text = 5000
txt_jual.Text = Val(txt_beli) + Val(txt_beli.Text * 0.5)
txt_laba.Text = Val(txt_jual.Text) - Val(txt_beli.Text)
ElseIf cb_barang.SelectedIndex = 3 Then
txt_beli.Text = 25000
txt_jual.Text = Val(txt_beli) + Val(txt_beli.Text * 0.5)
txt_laba.Text = Val(txt_jual.Text) - Val(txt_beli.Text)
ElseIf cb_barang.SelectedIndex = 4 Then
txt_beli.Text = 50000
txt_jual.Text = Val(txt_beli) + Val(txt_beli.Text * 0.05)
txt_laba.Text = Val(txt_jual.Text) - Val(txt_beli.Text)
Else
MsgBox("Gak Ada Pilihan")
End If
End Sub
End Class

5. Tampilan Hasil

You might also like