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

Rio Nicolas J.T - KODE-KODE PROGRAM - Fak - Ilmu Komputer

This document contains code for several programs including a menu program, calculator program, food menu program, student grading program, and password program. The code defines user interfaces, variables, constants, and event handlers for buttons and other controls. It uses logic and calculations to set prices and totals based on user input. The calculator code performs basic math operations like addition, subtraction, multiplication and division on numbers input by the user.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views4 pages

Rio Nicolas J.T - KODE-KODE PROGRAM - Fak - Ilmu Komputer

This document contains code for several programs including a menu program, calculator program, food menu program, student grading program, and password program. The code defines user interfaces, variables, constants, and event handlers for buttons and other controls. It uses logic and calculations to set prices and totals based on user input. The calculator code performs basic math operations like addition, subtraction, multiplication and division on numbers input by the user.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Rio Nicolas J.T |KODE-KODE PROGRAM | Fak.

Ilmu Komputer

KODE PROGRAM MENU UTAMA: Case 4: Txtpilharga.Text = "Rp.12.000"


Case 5: Txtpilharga.Text = "Rp.20.000"
Private Sub Command1_Click() Case 6: Txtpilharga.Text = "Rp.7.500"
If Text1.Text = "ANDES" Then Case Else: Txtpilharga.Text = "pilihan salah"
Label2.Visible = True End Select
End Sub
End Sub
Private Sub Command2_Click() KODE PROGRAM KALKULATOR:

End Sub Dim tamp As Double


Dim operator, operand As String
Private Sub mndaftar_Click() Dim ttk, ttk1 As Boolean
Form2.Show Dim a, nilai1 As Integer
End Sub
Private Sub Command10_Click()
Private Sub mnexit_Click() If operator = "+" Or operator = "*" Or operator
End = "/" Or operator = "-" Then
End Sub Text1.Text = ""
Text1.Text = Text1.Text & 2
Private Sub mnkalku_Click() operator = ""
Form3.Show Else
End Sub Text1.Text = Text1.Text & 2
End If
Private Sub mnlingkaran_Click() If ttk1 = True Then ttk = False
Form5.Show End Sub
End Sub
Private Sub Command11_Click()
Private Sub mnnilai_Click() If operator = "+" Or operator = "*" Or operator
Form4.Show = "/" Or operator = "-" Then
End Sub Text1.Text = ""
Text1.Text = Text1.Text & 3
Private Sub MNPASSWORD_Click() operator = ""
Form7.Show Else
End Sub Text1.Text = Text1.Text & 3
End If
Private Sub mnpro_Click() If ttk1 = True Then ttk = False
Form6.Show End Sub
End Sub
Private Sub Command12_Click()
Private Sub Text1_Change() If operator = "+" Or operator = "*" Or operator
= "/" Or operator = "-" Then
End Sub Text1.Text = ""
KODE PROGRAM MENU MAKAN: Text1.Text = Text1.Text & 4
operator = ""
Dim intpilihan Else
Text1.Text = Text1.Text & 4
Private Sub CmdKELUAR_Click() End If
End If ttk1 = True Then ttk = False
End Sub End Sub

Private Sub Form_Activate() Private Sub Command13_Click()


Txtpil1.SetFocus If operator = "+" Or operator = "*" Or operator
End Sub = "/" Or operator = "-" Then
Text1.Text = ""
Private Sub txtpil1_change() Text1.Text = Text1.Text & 5
intpilihan = Txtpil1.Text operator = ""
Select Case intpilihan Else
Case 1: Txtpilharga.Text = "Rp.10.000" Text1.Text = Text1.Text & 5
Case 2: Txtpilharga.Text = "Rp.8.500" End If
Case 3: Txtpilharga.Text = "Rp.5.000" If ttk1 = True Then ttk = False

1
Rio Nicolas J.T |KODE-KODE PROGRAM | Fak.Ilmu Komputer

End Sub Text1.Text = Text1.Text & 0


End If
Private Sub Command14_Click() End If
If operator = "+" Or operator = "*" Or operator If ttk1 = True Then ttk = False
= "/" Or operator = "-" Then End Sub
Text1.Text = ""
Text1.Text = Text1.Text & 6 Private Sub Command19_Click()
operator = "" If Left(Text1.Text, 1) = "-" Then
Else Text1.Text = Mid(Text1.Text, 2,
Text1.Text = Text1.Text & 6 Len(Text1.Text))
End If Else
If ttk1 = True Then ttk = False Text1.Text = "-" & Text1.Text
End Sub End If
End Sub
Private Sub Command15_Click()
If operator = "+" Or operator = "*" Or operator Private Sub Command20_Click()
= "/" Or operator = "-" Then If ttk = True Then
Text1.Text = "" Text1.Text = Text1.Text & "."
Text1.Text = Text1.Text & 7 ttk1 = True
operator = "" End If
Else End Sub
Text1.Text = Text1.Text & 7
End If Private Sub Command21_Click()
If ttk1 = True Then ttk = False On Error Resume Next
End Sub Text1.Text = Left(Text1.Text,
Len(Text1.Text) - 1)
Private Sub Command16_Click() End Sub
If operator = "+" Or operator = "*" Or operator
= "/" Or operator = "-" Then Private Sub Command22_Click()
Text1.Text = "" tamp = 0
Text1.Text = Text1.Text & 8 operator = ""
operator = "" operand = ""
Else ttk = True
Text1.Text = Text1.Text & 8 ttk1 = False
End If Text1.Text = ""
If ttk1 = True Then ttk = False Text1.SetFocus
End Sub End Sub

Private Sub Command17_Click() Private Sub Command23_Click()


If operator = "+" Or operator = "*" Or operator tamp = 0
= "/" Or operator = "-" Then tamp = Val(Text1.Text)
Text1.Text = "" operator = ""
Text1.Text = Text1.Text & 9 operator = "+"
operator = "" operand = "+"
Else End Sub
Text1.Text = Text1.Text & 9
End If Private Sub Command24_Click()
If ttk1 = True Then ttk = False tamp = 0
End Sub tamp = Val(Text1.Text)
operator = ""
Private Sub Command18_Click() operator = "-"
If operator = "+" Or operator = "*" Or operator operand = "-"
= "/" Or operator = "-" Then End Sub
If Not Text1.Text = "0" Then
Text1.Text = "" Private Sub Command25_Click()
Text1.Text = Text1.Text & 0 tamp = 0
End If tamp = Val(Text1.Text)
operator = "" operator = ""
Else operator = "*"
If Not Text1.Text = "0" Then operand = "*"

2
Rio Nicolas J.T |KODE-KODE PROGRAM | Fak.Ilmu Komputer

End Sub End Sub

Private Sub Command26_Click() Private Sub Command9_Click()


tamp = 0 If operator = "+" Or operator = "*" Or operator
tamp = Val(Text1.Text) = "/" Or operator = "-" Then
operator = "" Text1.Text = ""
operator = "/" Text1.Text = Text1.Text & 1
operand = "/" operator = ""
End Sub Else
Text1.Text = Text1.Text & 1
Private Sub Command27_Click() End If
Select Case operand If ttk1 = True Then ttk = False
Case "+" End Sub
hasil = Val(tamp) + Val(Text1.Text)
Case "-" Private Sub Form_Load()
hasil = Val(tamp) - Val(Text1.Text) ttk = True
Case "/" ttk1 = False
hasil = Val(tamp) / Val(Text1.Text) a=0
Case "*" End Sub
hasil = Val(tamp) * Val(Text1.Text)
End Select KODE PROGRAM NILAI MAHASISWA:
Text1.Text = ""
Text1.Text = hasil Private Sub CmdBERSIH_Click()
operator = "" SAPU
End Sub End Sub

Private Sub Command28_Click() Private Sub CmdKELUAR_Click()


tamp = 0 Form1.Show
operator = "" Unload Me
operand = "" End Sub
ttk = True Private Sub CmdPROSES_Click()
ttk1 = False LabelNA.Caption = ((Val(TxtPR.Text) * 2) +
Text1.Text = "" (Val(TxtUTS.Text) * 3) + (Val(TxtUAS.Text)
Text1.SetFocus * 5)) / 10
End Sub TimerNA.Enabled = True
If Val(LabelNA.Caption) < 50 Then
Private Sub Command29_Click() LabelPREDIKAT.Caption = "E"
Unload Me ElseIf Val(LabelNA.Caption) < 60 Then
End Sub LabelPREDIKAT.Caption = "D"
ElseIf Val(LabelNA.Caption) < 70 Then
Private Sub Command3_Click() LabelPREDIKAT.Caption = "C"
On Error Resume Next ElseIf Val(LabelNA.Caption) < 80 Then
Text1.Text = Val(Text1.Text) / 100 LabelPREDIKAT.Caption = "B"
End Sub Else
LabelPREDIKAT.Caption = "A"
Private Sub Command5_Click() End If
Text1.Text = Round(Sin(Text1.Text), 2) If LabelPREDIKAT.Caption = "A" Then
End Sub LabelNH.Caption = "ISTIMEWA"
ElseIf LabelPREDIKAT.Caption = "B" Then
Private Sub Command6_Click() LabelNH.Caption = "BAIK"
Text1.Text = Round(Cos(Text1.Text), 2) ElseIf LabelPREDIKAT.Caption = "C" Then
End Sub LabelNH.Caption = "CUKUP"
ElseIf LabelPREDIKAT.Caption = "D" Then
Private Sub Command7_Click() LabelNH.Caption = "KURANG"
Text1.Text = Round(Tan(Text1.Text), 2) Else
End Sub LabelNH.Caption = "BURUK"
End If
Private Sub Command8_Click() If LabelNH.Caption = "BURUK" Then
On Error Resume Next LabelKET.Caption = "TIDAK LULUS"
Text1.Text = Sqr(Text1.Text) ElseIf LabelNH.Caption = "KURANG" Then

3
Rio Nicolas J.T |KODE-KODE PROGRAM | Fak.Ilmu Komputer

LabelKET.Caption = "NGULANG" Private Sub CE_Click()


Else End
LabelKET.Caption = "LULUS" End Sub
End If
If LabelKET.Caption = "TIDAK LULUS"
Then KODE PROGRAM LINGKARAN:
LabelKET.ForeColor = vbRed
ElseIf LabelKET.Caption = "NGULANG" Private Sub CH_Click()
Then TL.Text = 3.14 * (Val(TJ.Text) ^ 2)
LabelKET.ForeColor = vbRed End Sub
End If
If LabelPREDIKAT.Caption = "D" Then Private Sub CR_Click()
LabelPREDIKAT.ForeColor = vbRed TL.Text = ""
ElseIf LabelPREDIKAT.Caption = "E" Then TJ.Text = ""
LabelPREDIKAT.ForeColor = vbRed TJ.SetFocus
End If End Sub
End Sub
Private Sub Form_Load()
CmbJUR.AddItem "TEKNIK KODE PROGRAM PASSWORD:
INFORMATIKA" Private Sub Command1_Click()
CmbJUR.AddItem "SYSTEM INFORMASI" If Text1.Text = "12345" Then
CmbSTR.AddItem "I" Image1.Visible = True
CmbSTR.AddItem "II" Text1.Enabled = False
CmbSTR.AddItem "III" Command1.Enabled = False
CmbSTR.AddItem "IV" Else
CmbSTR.AddItem "V" MsgBox "Passwordnya Salah PAL!!"
CmbSTR.AddItem "VI" Text1.Text = ""
CmbSTR.AddItem "VII" Text1.SetFocus
CmbSTR.AddItem "VIII" End If
End Sub End Sub
Sub SAPU()
TxtNAM.Text = ""
TxtNP.Text = ""
CmbJUR.Text = ""
CmbSTR.Text = ""
TxtPR.Text = ""
TxtUTS.Text = ""
TxtUAS.Text = ""
TxtMK.Text = ""
LabelPREDIKAT.Caption = ""
LabelNA.Caption = ""
LabelNH.Caption = ""
LabelKET.Caption = ""
Frame1.Enabled = False
TxtNAM.SetFocus
End Sub
Private Sub TimerNA_Timer()
If LabelKET.Visible = True Then
LabelKET.Visible = False Else
LabelKET.Visible = True
End Sub

Private Sub TxtMK_LostFocus()


Frame1.Caption = TxtMK.Text
Frame1.Enabled = True
End Sub

Private Sub Command1_Click()

End Sub

You might also like