TUGAS VISUAL BASIC

NAMA : RIPI HARYATI

NPM: 11100009

KELAS : YAHOO 1

 

PRAKTIKUM 1

SEBELUM DIJALANKAN

LISTING PROGRAM 1

 

Private Sub Combo1_Click()

Dim nama, jurusan As String

Select Case Combo1.Text

Case “11102032”

nama = “RIPI”

jurusan = “ManajemenInformatika”

Case “11102042”

nama = “ESTI”

jurusan = “SistemInformatika”

Case “11102052”

nama = “DIANA”

jurusan = “ManajemenInformatika”

End Select

Text1.Text = nama

Text2.Text = jurusan

Text3.SetFocus

End Sub

 

Private Sub Command1_Click()

Dim Quis, Tgs, UTS, UAS, NA As Integer

Dim HmAs String

Quis = Val(Text3.Text)

Tgs = Val(Text4.Text)

UTS = Val(Text5.Text)

UAS = Val(Text6.Text)

NA = (Quis + Tgs + UTS + UAS) / 4

Text7.Text = NA

Select Case Text7.Text

Case Is > 80

Hm = “A”

Case Is > 70

Hm = “B”

Case Is > 60

Hm = “C”

Case Is > 50

Hm = “E”

End Select

Text8.Text = Hm

End Sub

 

Private Sub Command2_Click()

Text1.Text = “”

Text2.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

Text7.Text = “”

Text8.Text = “”

Combo1.Text = “”

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

 

Private Sub Form_Load()

Combo1.AddItem “11102032”

Combo1.AddItem “11102042”

Combo1.AddItem “11102052”

End Sub

 

Private Sub Text3_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text4.SetFocus

End If

End Sub

 

Private Sub Text4_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text5.SetFocus

End If

End Sub

 

Private Sub Text5_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text6.SetFocus

End If

End Sub

 

Private Sub Text6_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text7.SetFocus

End If

End Sub

 

PRAKTIKUM 2

SEBELUM DIJALANKAN

LISTING PROGRAM 2

 

Private Sub cdmkeluar_Click()

Unload Me

End Sub

 

Private Sub cmdproses_Click()

txtD.Text = Val(txtA.Text) + Val(txtB.Text) + Val(txtC.Text)

txtE.Text = Val(txtD.Text) * (0.1)

txtF.Text = Val(txtD.Text) – Val(txtE.Text)

End Sub

 

Private Sub cmdulang_Click()

Combo1.SetFocus

Combo1.Text = “SILAHKAN KLIK DISINI”

txtA = “”

txtB = “”

txtC = “”

txtD = “”

txtE = “”

txtF = “”

End Sub

 

Private Sub Combo1_Click()

Select Case Combo1.Text

Case “A”

gapok = 1200000

tunjangan = 200000

Case “B”

gapok = 1000000

tunjangan = 150000

Case “C”

gapok = 800000

tunjangan = 100000

End Select

txtA.Text = gapok

txtB.Text = tunjangan

txtC.SetFocus

End Sub

 

Private Sub Form_Activate()

Combo1.SetFocus

txtA = “”

txtB = “”

txtC = “”

txtD = “”

txtE = “”

txtF = “”

End Sub

 

Private Sub Form_Load()

txtA = “”

txtB = “”

txtC = “”

txtD = “”

txtE = “”

txtF = “”

Combo1.AddItem “A”

Combo1.AddItem “B”

Combo1.AddItem “C”

End Sub

 

Private Sub txtC_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

txtD.Text = Val(txtA.Text) + Val(txtB.Text) – Val(txtC.Text)

txtE.Text = Val(txtD.Text) * (0.1)

txtF.Text = Val(txtD.Text) – Val(txtE.Text)

End If

End Sub

 

 

PRAKTIKUM 3

SEBELUM DIJALANKAN

LISTING PROGRAM 3

 

Private Sub Combo1_Click()

Dim gapok, pajak, tunjangan, total As Variant

Select Case Combo1.Text

Case “I”

gapok = 1500000

tunjangan = 150000

Case “II”

gapok = 2000000

tunjangan = 200000

Case “III”

gapok = 2500000

tunjangan = 250000

Case “IV”

gapok = 3000000

tunjangan = 300000

Case Else

gapok = 0

tunjangan = 0

End Select

total = gapok + tunjangan

pajak = total * 0.1

Text3.Text = gapok

Text4.Text = tunjangan

Text5.Text = pajak

Text6.Text = total – pajak

End Sub

Public Sub Kosong()

Text1.SetFocus

Text1.Text = “”

Text2.Text = “”

Combo1.Text = “”

Text3.Text = “”

Text4.Text = “”

Text5.Text = “”

Text6.Text = “”

End Sub

 

Private Sub Command1_Click()

Kosong

End Sub

 

Private Sub Command2_Click()

Kosong

End Sub

 

Private Sub Command3_Click()

Unload Me

End Sub

Private Sub Form_Load()

Combo1.AddItem “I”

Combo1.AddItem “II”

Combo1.AddItem “III”

Combo1.AddItem “IV”

End Sub

 

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then

Text2.SetFocus

End If

End Sub

 

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