Temen-temen yang masih sekulah, di jurusan RPL pasti sering dpt tugas buat ngebikin program yang salah satunya membuat program dengan Visual Basic atau yang lebih dikenal dengan sebutan VB.
Program yang Qu buat nie adalah satu program yang dapat melakukan operasi hitung pada beberapa bangun datar maupun ruang yang emank udah Qu atur buat bisa menghitung nya. Intinya dalam program ini, kita harus bisa manfaatin setiap fasilitas dan juga logika dalam fikiran qTa buat bisa ngrancag script yang kaya di bawah ini.
Mungkin buat temen2 yang baca post ini ada yang ngira ini mudah dan enggak penting, tapi aQu pasti yakin temen2 'kan ada yang bisa Qu bantuin dengan postingan ini. Buat bikin program yang satu nie, temen2 cuma butuh beberapa Option, Command, Text, dan Label, n ga' lupa pemahaman tentang Logika IF sama *.visible za. buat lebih mudahnya ini aQu sudah nyediain script yang dah jadi, dengan 9 rumus berbeda.Private Sub Command1_Click()
If Text4.Text = "linkaran" Then
phi = 22 / 7
r = Text2.Text
luas = phi * r ^ 2
Label3.Caption = luas
Label9.Caption = "Luas Lingkaran"
Else
End If
If Text4.Text = "persegi" Then
luas = Val(Text1) * Val(Text2)
Label3.Caption = luas
Label9.Caption = "Luas Persegi:"
End If
If Text4.Text = "kubus" Then
s = Text1.Text
luas = 6 * (s ^ 2)
Label3.Caption = luas
Label9.Caption = "Luas Permukaan Kubus:"
End If
If Text4.Text = "tabung" Then
r = Text2.Text
t = Text3.Text
phi = 22 / 7
a = phi * (r ^ 2)
k = phi * (2 * r)
b = k * t
luas = 2 * a + b
Label3.Caption = luas
Label9.Caption = "Luas Permukaan Tabung:"
End If
If Text4.Text = "balok" Then
p = Text1.Text
l = Text2.Text
t = Text3.Text
luas = 2 * (p * l + p * t + l * t)
Label3.Caption = luas
Label9.Caption = "Luas Permukaan Balok:"
End If
If Text4.Text = "segi3" Then
a = Text1.Text
t = Text2.Text
luas = a * t / 2
Label3.Caption = luas
Label9.Caption = "Luas Segitiga:"
End If
If Text4.Text = "piramid" Then
a = Text1.Text
t = Text2.Text
s = ((1 / 2 * a) ^ 2 + t ^ 2) ^ (1 / 2)
luas = (a ^ 2) + (4 * (a * s / 2))
Label3.Caption = luas
Label9.Caption = "Luas Permukaan Piramida:"
End If
If Text4.Text = "kerucut" Then
r = Text2.Text
t = Text3.Text
phi = 22 / 7
l1 = phi * r ^ 2
s = (r ^ 2 + t ^ 2) ^ (1 / 2)
d = phi * s * 2
w = phi * r * 2
p = w / d
l2 = (phi * (s ^ 2)) * p
luas = l1 + l2
Label3.Caption = luas
Label9.Caption = "Luas Permukaan Kerucut:"
End If
If Text4.Text = "bola" Then
r = Text2.Text
phi = 22 / 7
luas = 4 * phi * (r ^ 2)
Label3.Caption = luas
Label9.Caption = "Luas Permukaan atau Kulit Bola:"
End If
End Sub
Private Sub Command2_Click()
If Text4.Text = "linkaran" Then
phi = 22 / 7
r = Text2.Text
Keliling = phi * (r * 2)
Label3.Caption = Keliling
Label9.Caption = "Keliling Linkaran:"
End If
If Text4.Text = "persegi" Then
k = Val(Text1) + Val(Text2)
Keliling = 2 * k
Label3.Caption = Keliling
Label9.Caption = "Keliling Persegi:"
End If
If Text4.Text = "segi3" Then
a = Text1.Text
t = Text2.Text
Keliling = a * t
Label3.Caption = Keliling
Label9.Caption = "Keliling Segitiga:"
End If
If Text4.Text = "kubus" Then
s = Text1.Text
v = s ^ 3
Label3.Caption = v
Label9.Caption = "Volume Kubus:"
End If
If Text4.Text = "tabung" Then
r = Text2.Text
t = Text3.Text
phi = 22 / 7
v = phi * (r ^ 2) * t
Label3.Caption = v
Label9.Caption = "Volume Tabung:"
End If
If Text4.Text = "balok" Then
p = Text1.Text
l = Text2.Text
t = Text3.Text
v = p * l * t
Label3.Caption = v
Label9.Caption = "Volume Balok:"
End If
If Text4.Text = "piramid" Then
a = Text1.Text
t = Text2.Text
v = a ^ 2 * t / 3
Label3.Caption = v
Label9.Caption = "Volume Piramida:"
End If
If Text4.Text = "kerucut" Then
r = Text2.Text
t = Text3.Text
phi = 22 / 7
v = phi * (r ^ 2) * t
Label3.Caption = v
Label9.Caption = "Volume Kerucut:"
End If
If Text4.Text = "bola" Then
r = Text2.Text
phi = 22 / 7
v = (4 / 3) * phi * (r ^ 3)
Label3.Caption = v
Label9.Caption = "Volume Bola:"
End If
End Sub
Private Sub Command4_Click()
If Text4.Text = "linkaran" Then
Text2.Text = ""
Label3.Caption = ""
Label9.Caption = ""
End If
If Text4.Text = "persegi" Then
Text1.Text = ""
Text2.Text = ""
Label3.Caption = ""
Label9.Caption = ""
End If
If Text4.Text = "kubus" Then
Text1.Text = ""
Label3.Caption = ""
Label9.Caption = ""
End If
If Text4.Text = "tabung" Then
Text2.Text = ""
Text3.Text = ""
Label3.Caption = ""
Label9.Caption = ""
End If
If Text4.Text = "balok" Then
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label3.Caption = ""
Label9.Caption = ""
End If
If Text4.Text = "segi3" Then
Text1.Text = ""
Text2.Text = ""
Label3.Caption = ""
Label9.Caption = ""
End If
If Text4.Text = "piramid" Then
Text1.Text = ""
Text2.Text = ""
Label3.Caption = ""
Label9.Caption = ""
End If
If Text4.Text = "kerucut" Then
Text2.Text = ""
Text3.Text = ""
Label3.Caption = ""
Label9.Caption = ""
End If
If Text4.Text = "bola" Then
Text2.Text = ""
Label3.Caption = ""
Label9.Caption = ""
End If
End Sub
Private Sub Command5_Click()
End
End Sub
Private Sub Image1_Click()
End Sub
Private Sub Label5_Click()
Label5.Caption = ""
If Label5.Caption = "4y0o HiTung9 cUey!!!" Then Text4.Visible = False
End Sub
Private Sub Option1_Click()
Text4.Text = "linkaran"
Label2.Visible = True
Text2.Visible = True
Text4.Visible = False
Text3.Visible = False
Label4.Visible = False
Label1.Caption = "Phi"
Text1.Text = "22/7"
Text1.Enabled = False
Text2.Text = ""
Label1.Caption = "Phi"
Label2.Caption = "Jari-jari"
Label3.Caption = ""
Label6.Caption = "Hanya Untuk Operasi Hitung Lingkaran Sempurna"
Label7.Caption = "Masukkan Nilai Jari-Jari"
Command2.Caption = "Keliling"
Command1.Caption = "Luas"
End Sub
Private Sub Option2_Click()
Text1.Enabled = True
Text4.Text = "persegi"
Text4.Visible = False
Label2.Visible = True
Text2.Visible = True
Label1.Caption = "Panjang"
Label2.Caption = "Lebar"
Text1.Text = ""
Text2.Text = ""
Label3.Caption = ""
Text3.Visible = False
Label4.Visible = False
Label6.Caption = "Bisa Digunakan Untuk Bujursangkar Maupun Persegi Panjang"
Label7.Caption = "Masukkan Nilai Panjang dan Lebar"
Command2.Caption = "Luas"
Command1.Caption = "Keliling"
End Sub
Private Sub Option3_Click()
Text1.Enabled = True
Text4.Text = "kubus"
Text4.Visible = False
Label1.Caption = "Rusuk"
Label2.Visible = False
Label4.Visible = False
Text1.Text = ""
Text2.Visible = False
Label3.Caption = ""
Text3.Visible = False
Label4.Visible = False
Label6.Caption = "Digunakan Untuk Operasi Hitung Kubus"
Label7.Caption = "Masukkan Nilai Rusuk"
Command2.Caption = "Volume"
Command1.Caption = "Luas P."
End Sub
Private Sub Option4_Click()
Text4.Text = "tabung"
Text4.Visible = False
Label1.Caption = "Phi"
Text1.Text = "22/7"
Text1.Enabled = False
Label2.Caption = "Jari-jari"
Label4.Caption = "Tinggi"
Text1.Text = "22/7"
Text2.Text = ""
Label3.Caption = ""
Text3.Visible = True
Text2.Visible = True
Label2.Visible = True
Label4.Visible = True
Label6.Caption = "Digunakan Untuk Operasi Hitung Tabung"
Label7.Caption = "Masukkan Nilai Jari-jari dan Tinggi"
Command2.Caption = "Volume"
Command1.Caption = "Luas P."
End Sub
Private Sub Option5_Click()
Text1.Enabled = True
Text4.Text = "balok"
Text4.Visible = False
Text3.Text = ""
Label1.Caption = "Panjang"
Label2.Caption = "Lebar"
Label4.Caption = "Tinggi"
Text1.Text = ""
Text2.Text = ""
Label3.Caption = ""
Text3.Visible = True
Label4.Visible = True
Label6.Caption = "Digunakan Untuk Operasi Hitung Balok"
Label7.Caption = "Masukkan Nilai Panjang, Lebar dan Tinggi"
Command2.Caption = "Volume"
Command1.Caption = "Luas P."
End Sub
Private Sub Option6_Click()
Text1.Enabled = True
Text4.Text = "segi3"
Text1.Visible = True
Text2.Visible = True
Text1.Text = ""
Text2.Text = ""
Text3.Visible = False
Label4.Visible = False
Label3.Caption = ""
Label6.Caption = "Digunakan Untuk Operasi Hitung Segitiga Siku-siku"
Label7.Caption = "Masukkan Nilai Alas dan Tinggi"
Label1.Caption = "Alas"
Label2.Caption = "Tinggi"
Command2.Caption = "Keliling"
Command1.Caption = "Luas"
End Sub
Private Sub Option7_Click()
Text1.Enabled = False
Text4.Text = "piramid"
Text1.Visible = True
Text2.Visible = True
Text3.Visible = False
Label1.Visible = True
Label2.Visible = True
Label4.Visible = False
Label3.Caption = ""
Label1.Caption = "Lebar Alas"
Label2.Caption = "Tinggi Piramida"
Label6.Caption = "Digunakan Untuk Operasi Hitung Piramida Alas Persegi 4"
Label7.Caption = "Masukkan Nilai Lebar Alas dan Tinggi Piramida"
Command2.Caption = "Volume"
Command1.Caption = "Luas P."
Text2.Text = ""
End Sub
Private Sub Option8_Click()
Label1.Visible = True
Label1.Caption = "phi"
Label2.Caption = "Jari-Jari"
Label2.Visible = True
Label4.Visible = True
Label4.Caption = "Tinggi"
Text1.Visible = True
Text2.Visible = True
Text3.Visible = True
Label6.Caption = "Digunakan Untuk Operasi Hitung pada Kerucut"
Label7.Caption = "Masukkan Nilai Jari-Jari dan Tinggi Kerucut"
Text4.Text = "kerucut"
Command1.Caption = "Luas P."
Command2.Caption = "Volume"
Text1.Enabled = False
Text2.Text = ""
Text3.Text = ""
Text1.Text = "22/7"
End Sub
Private Sub Option9_Click()
Label1.Visible = True
Label1.Caption = "Phi"
Label2.Caption = "Jari-Jari"
Label2.Visible = True
Label4.Visible = False
Text1.Visible = True
Text2.Visible = True
Text3.Visible = False
Label6.Caption = "Digunakan Untuk Operasi Hitung pada Bola"
Label7.Caption = "Masukkan Nilai Jari-Jari Bola "
Text4.Text = "bola"
Command1.Caption = "Luas Kulit"
Command2.Caption = "Volume"
Text1.Enabled = False
Text1.Text = "22/7"
Text2.Text = ""
End Sub
Private Sub Picture1_Click()
End Sub
do'akan yaaaaa........... spy aQu bsa buat posting ky gni Lagi.........
0 C0Mm3nTs:
Posting Komentar