Aplikasi Konversi Desimal Biner

Converter biner-Kubat

Converter biner-Kubat

Berikut ini adalah penjelasan coding dari program decimal – biner converter buatan saya dengan menggunakan Visual Basic 2008 Express Edition

No

Komponen

Properties

Nilai

1

Form

Name

Form1

Text

Aplikasi Konversi Desimal Biner

2

Label

Text

Konversi Desimal dan Biner

Text

Nilai

3

Textbox1

Name

Nilai

Text

0

4

Textbox2

Name

Hasil

Text

0

5

Button1

Name

Btnkonversi

Text

&Konversi

6

Button2

Name

Btnreset

Text

&Reset

7

Button3

Name

Btnexit

Text

&Exi


Public Class Form1
Dim n, pem, sisa, has As Long
Dim bin As String
Dim response As MsgBoxResultPrivate Sub btnkonversi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnkonversi.Click
If rbdec2bin.Checked Then
n = nilai.Text
While n > pem
has = n \ 2
sisa = n Mod 2
bin = Str(sisa) & bin
n = has
End While
hasil.Text = bin
bin = ""
Else
hasil.Text = 0
For g As Integer = Len(nilai.Text) To 1 Step -1
hasil.Text = hasil.Text + Mid(nilai.Text, g, 1) * (2 ^ (Len(nilai.Text) - g))
Next g
End If
End Sub
‘----------------------------------------------------------------

Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnexit.Click
response = MsgBox(“Apakah Anda yakin ingin keluar”, MsgBoxStyle.OkCancel, “Konfirmasi Keluar”)
If response = MsgBoxResult.Ok Then
End
End If
End Sub
‘——————————————————————
Private Sub btnreset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreset.Click
nilai.Text = “”
hasil.Text = “”
End Sub
End Class

NAMA_NRP_KELOMPOK_Aplikasi Konverter_biner_Desimal
Aplikasi Konverter Desimal-Biner

2 thoughts on “Aplikasi Konversi Desimal Biner

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s