Postingan

Menampilkan postingan dari Mei, 2020

PROGRAM MENCARI NILAI TERBESAR

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click         Dim angkaTerbesar As Single         If (CSng(TextBox1.Text) > CSng(TextBox2.Text)) Then             angkaTerbesar = CSng(TextBox1.Text)         Else             angkaTerbesar = CSng(TextBox2.Text)         End If         TextBox3.Text = "Angka terbesar adalah: " & angkaTerbesar     End Sub End Class

PROGRAM MEMBUAT FILE .TXT

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click         My.Computer.FileSystem.WriteAllText("D:\file.txt", TextBox1.Text, True)         MsgBox("File berhasil disimpan")     End Sub     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click         Close()     End Sub End Class

MENCARI LUAS SEGITIGA

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click         TextBox1.Text = ""         TextBox2.Text = ""         TextBox3.Text = ""     End Sub     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click         TextBox3.Enabled = False         TextBox3.Text = Val(0.5) * Val(TextBox1.Text) * Val(TextBox2.Text)     End Sub End Class

LUAS DAN KELILING LINGKARAN

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click         Dim phi As Integer         Dim Luas As Integer         Dim keliling As Integer         phi = 22 / 7         Luas = phi * (TextBox1.Text * TextBox1.Text)         keliling = 2 * phi * TextBox1.Text         TextBox2.Text = Luas         TextBox3.Text = keliling     End Sub     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click         TextBox1.Text = " "         TextBox2.Text = " "         TextBox3.Text = " "     End Sub End Class

LOGIN

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Login.Click         Hide()         Login.Show()         If txtID.Text = "sriwahyuni" And                 txtPassword.Text = "1234567" Then             Login.Show()         Else             MessageBox.Show("ID atau Password salah", "Konvirmasi",                       MessageBoxButtons.OK, MessageBoxIcon.Information)         End If     End Sub     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click         MsgBox("Apakah anda yakin mau keluar?", MsgBoxStyle.YesNo, "Peringatan!")     End Sub     Private Sub txtPassword_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtPassword.TextChanged         Login.Show()     End Sub     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System

LIMAS SEGIEMPAT

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)     End Sub     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click         Dim sisi, alas, tinggi, hasil As Integer         sisi = Val(txtsisi.Text)         alas = Val(txtalas.Text)         tinggi = Val(txttinggi.Text)         hasil = Val(1 / 3 * txtalas.Text * txttinggi.Text)         txthasil.Text = hasil     End Sub End Class

KONVERSI WAKTU

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Private Sub btnmulai_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnmulai.Click         Dim hour, minute, second As Long         Dim a, b As Long         a = TextBox1.Text         hour = Int(a / 3600)         b = hour * 3600         minute = Int((a - b) / 60)         second = a - b - (minute * 60)         MsgBox("Hasil Konversi = " & hour & " Jam " & minute & " menit " & second & " Detik ", vbOKOnly)     End Sub End Class

KONVERSI ANGKA

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Private Sub BtnKonversi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnKonversi.Click         Dim nilai As Integer         Dim huruf As String         nilai = txtnilai.Text         If nilai >= 90 Then             huruf = "A"         ElseIf nilai >= 80 Then             huruf = "B"         ElseIf nilai >= 70 Then             huruf = "C"         ElseIf nilai >= 60 Then             huruf = "D"         Else             huruf = "E"         End If         LblHasil.Text = huruf     End Sub End Class

KASIR

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load         Dim Arr(4, 1) As String         Arr(0, 0) = "Kode Barang"         Arr(0, 1) = "Nama Barang"         Arr(1, 0) = "Jenis"         Arr(1, 1) = "Satuan"         Arr(2, 0) = "Sabun Mandi"         Arr(2, 1) = "Pasta Gigi"         Arr(3, 0) = "Pcs"         Arr(3, 1) = "Box"         Arr(4, 0) = "Lusin"         Arr(4, 1) = "Kodi"         ListView1.GridLines = True         ListView1.View = View.Details         For Baris = 0 To 1             For kolom = 0 To 1                 ListView1.Columns.Add(Arr(Baris, kolom), 100)             Next kolom         Next Baris         For Baris = 2 To 2             For kolom = 0 To 1                 CmbJenis.Items.Add(Arr(Baris, kolom))             Next kolom         Next Baris         For Baris = 3

KALKULATOR

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Dim Angka, Hasil As Double     Const phi As Double = 22 / 7     Dim Rumus As String     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load     End Sub     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click         If TextBox1.Text = "" Then             TextBox1.Text = "1"         Else             TextBox1.Text = TextBox1.Text & "1"         End If     End Sub     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click         If TextBox1.Text = "" Then             TextBox1.Text = "2"         Else             TextBox1.Text = TextBox1.Text & "2"         End If     End Sub     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click         If TextBox1.Text =

JAM DIGITAL

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick         Label1.Text = TimeOfDay     End Sub End Class

PROGRAM HARGA BUAH

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Dim total, bayar, kembali As Double     Dim cb As CheckBox()     Dim tharga As TextBox()     Dim jm As TextBox()     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load         cb = New CheckBox() {cb1, cb2, cb3, cb4, cb5, cb6}         tharga = New TextBox() {Tharga1, Tharga2, Tharga3, Tharga4, Tharga5, Tharga6}         jm = New TextBox() {Jm1, Jm2, Jm3, Jm4, Jm5, Jm6}     End Sub     Private Sub bhitung_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bhitung.Click         Dim i As Integer         total = 0         For i = 0 To 5             If cb(i).Checked = True Then                 total = total + (Val(tharga(i).Text) * Val(jm(i).Text))             End If         Next         ttotal.Text = "RP." & Format(total, "#,#.##")     End Sub     Private Sub bx_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bx.

HITUNG GAJI

Gambar
Nama : SRIWAHYUNI NIM : 19010020 \Public Class frmpenggajian     Sub awal()         'isi data pilihan dalam combo box         cbjabatan.Items.Clear()         cbjabatan.Items.Add("Direktur")         cbjabatan.Items.Add("Manajer")         cbjabatan.Items.Add("Karyawan")         cbjabatan.Items.Add("OB")         'Mengosongkan isian         txtnama.Text = ""         txtgapok.Text = ""         txttjjabatan.Text = ""         txttjnikah.Text = ""         txttjjabatan.Text = ""         txttjgakot.Text = ""         txtppn.Text = ""         txtgaber.Text = ""         txtnama.Focus()         'Mengosongkan pilihan radio button         rbblmmenikah.Checked = False         rbmenikah.Checked = False     End Sub     Private Sub frmpenggajian_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load         awal()     End Sub     Private Sub cbja

PROGRAM BINTANG

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Private Sub membuat_bintang_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)         txt_hasil.Enabled = False     End Sub     Private Sub btnproses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnproses.Click         txt_hasil.Text = ""         Dim n As Integer         Dim i As Integer         n = Val(txt_input.Text)         For i = 1 To n             txt_hasil.Text += StrDup(i, "*") + vbNewLine         Next i     End Sub     Private Sub btnhapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhapus.Click         txt_input.Text = ""         txt_hasil.Text = ""     End Sub     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load     End Sub End Class

PROGRAM ALARM

Gambar
Nama : SRIWAHYUNI NIM : 19010020 Public Class Form1     Dim alarm As Boolean       Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click         If alarm = True Then             Timer2.Enabled = False             Button1.Text = "Aktif"             alarm = False         Else             Button1.Text = "Tidak Aktif"             alarm = True         End If     End Sub     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click         End     End Sub     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load         alarm = False     End Sub     Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick         Label2.Text = TimeString         If TextBox1.Text = Label2.Text And alarm = True Then             Timer2.Enabled = True         End If     End Sub     Private Sub Ti