Pada kesempatan kali ini penulis akan menjabarkan source code dan tampilan dari program "Menghitung Waktu Pengisian dan Pengosongan Kapasitor Pada Suatu Rangkaian RC". Program ini dibuat dengan menggunakan Visual Basic 6.0 Enterprise Edition.
Source Code:
Dim a, b, c As Double
Private Sub Pengisian_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = 5 * a * b * 0.000001
Text3.Text = c
Form1.Picture2.Visible = True
Form1.Picture1.Visible = False
Form1.Picture3.Visible = False
Pengosongan.Enabled = False
Form1.Picture1.Visible = False
Form1.Picture3.Visible = False
Pengosongan.Enabled = False
End Sub
Private Sub Pengosongan_Click()
a = Val(Text1.Text)
b = Val(Text2.Text)
c = 5 * a * b * 0.000001
Text3.Text = c
a = Val(Text1.Text)
b = Val(Text2.Text)
c = 5 * a * b * 0.000001
Text3.Text = c
Form1.Picture1.Visible = True
Form1.Picture2.Visible = False
Form1.Picture3.Visible = False
Pengisian.Enabled = False
Form1.Picture2.Visible = False
Form1.Picture3.Visible = False
Pengisian.Enabled = False
End Sub
Private Sub Baru_Click()
Text1.Text = Clear
Text2.Text = Clear
Text3.Text = Clear
Text2.Text = Clear
Text3.Text = Clear
Form1.Picture3.Visible = True
Form1.Picture2.Visible = False
Form1.Picture1.Visible = False
Pengosongan.Enabled = True
Pengisian.Enabled = True
Form1.Picture2.Visible = False
Form1.Picture1.Visible = False
Pengosongan.Enabled = True
Pengisian.Enabled = True
End Sub
Tampilan dari program:
Flowchart dari program:
No comments:
Post a Comment