Haloo guys..
kali ini gue mau share tentang program zodiak yang di buat pake program pascal nih..
btw program pascal itu ada 2 aplikasi nya
yang pertama yang versi windows alias turbo pascal
sedangkan yang kedua itu versi dos nya..
sekilas ga ada perbedaan sih sama aja cuman beda di tampilan nya doang.
kalo gue sih pake yang dos nya..
buat pemakaian sih sesuai selera kalian aja lebih seneng pake versi dos atau turbo pascal
nah langsung aja deh ini syntak nya program zodiak menggunakan pascal
--------------------------------------------------------------------------------------------------------------------------
program zodiakdanramalan;
uses crt;
var
no, tgl, bln, thn : integer;
ramalan, nama : string;
begin
clrscr;
writeln(' Welcome to My Blog');
writeln(' Zodiak dan Ramalan');
writeln('-------------------------------------------');
writeln('');
writeln(' Nama : Fariz Achmad Fauzi');
writeln(' NIM : 153213046');
writeln(' Jurusan : Managenen Informatika');
writeln(' Semester: 1(Ganjil)');
writeln('-------------------------------------------');
writeln('');
write('Nama : '); readln(nama);
write('Bulan Lahir (angka) : '); readln(bln);
begin
if(bln=1) then
begin
writeln('January');
write('Tanggal Lahir : '); readln(tgl);
if (tgl<=20) then
writeln( 'Zodiak anda Capricorn');
if(tgl>=21)then
writeln('Zodiak anda Aquarius');
writeln('');
write('Ingin tahu ramalan Capricorn/Aquarius? ketik(c= capricorn, a= aquarius) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='c') then
begin
writeln(' Karakter Capricorn : ');write
writeln('1. Gengsi tinggi');
writeln('2. Rajin');
writeln('3. Pendiam');
writeln('4. Materialis');
writeln('5. Teguh Pendirian');
end;
if(ramalan='a')then
begin
writeln(' Karakter Aquarius : ');
writeln('1. Jenius');
writeln('2. Objektif');
writeln('3. Tenang');
writeln('4. Cepat Mengerti');
end;
end;
end;
begin
if(bln=2) then
begin
writeln('Febduari');
write('Masukan Tanggal Lahir anda : '); readln(tgl);
if (tgl<=20) then
writeln('Zodiak anda Aquarius');
if(tgl>=21) then
writeln('Zodiak anda Pisces');
writeln('');
write('Ingin tahu ramalan Aquarius/Pisces? ketik(a= aquarius, p= pisces) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='a') then
begin
writeln(' Karakter Aquarius : ');
writeln('1. Jenius');
writeln('2. Objektif');
writeln('3. Tenang');
writeln('4. Cepat Mengerti');
end;
if(ramalan='p')then
begin
writeln(' Karakter Pisces : ');
writeln('1. Praktis');
writeln('2. Sosial tinggi');
writeln('3. Pemimpi');
writeln('4. Penasaran');
end;
end;
end;
begin
if(bln=3) then
begin
writeln('Maret');
write('Masukan Tanggal Lahir anda : '); readln(tgl);
if(tgl<=20) then
writeln('Zodiak anda Pisces');
if(tgl>=21) then
writeln('Zodiak anda Aries');
writeln('');
write('Ingin tahu ramalan Pisces/Aries? ketik(p= pisces ar= aries) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='p') then
begin
writelnwriteln(' Karakter Pisces : ');
writeln('1. Praktis');
writeln('2. Sosial tinggi');
writeln('3. Pemimpi');
writeln('4. Penasaran');
end;
if(ramalan='ar')then
begin
writeln(' Karakter Aries : ');
writeln('1. Lincah');
writeln('2. Emosi Labil');
writeln('3. Energik');
writeln('4. Agresif');
end;
end;
end;
begin
if(bln=4) then
begin
writeln('April');
write('Masukan Tanggal Lahir anda : '); readln(tgl);
if(tgl<=20) then
writeln('Zodiak anda aries');
if(tgl>=21) then
writeln('Zodiak Anda Taurus');
writeln('');
write('Ingin tahu ramalan Aries/Taurus? ketik(ar= aries t= taurus) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='ar') then
begin
writeln(' Karakter Aries : ');
writeln('1. Lincah');
writeln('2. Emosi Labil');
writeln('3. Energik');
writeln('4. Agresif');
end;
if(ramalan='t')then
begin
writeln(' Karakter Taurus : ');
writeln('1.Matearlis');
writeln('2. Keras Kepala');
writeln('3. Setia');
writeln('4. Ramah');
writeln('5. Sabar');
end;
end;
end;
begin
if(bln=5) then
begin
writeln('Mei');
write('Masukan Tanggal Lahir anda : '); readln(tgl);
if(tgl<=20) then
writeln('Zodiak anda Taurus');
if(tgl>=21) then
writeln('Zodiak anda Gemini');
writeln('');
write('Ingin tahu ramalan Taurus/Gemini? ketik(t= taurus g= gemini) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='t') then
begin
writeln(' Karakter Taurus : ');
writeln('1.Matearlis');
writeln('2. Keras Kepala');
writeln('3. Setia');
writeln('4. Ramah');
writeln('5. Sabar');
end;
if(ramalan='g')then
begin
writeln(' Karakter Gemini : ');
writeln('1. Pandai');
writeln('2. Lincah');
writeln('3. Labil');
writeln('4. Gugup');
writeln('5. Jiwa Sosial');
end;
end;
end;
begin
if(bln=6) then
begin
writeln('Juni');
write('Masukan Tanggal Lahir anda : ');readln(tgl);
if(tgl<=20) then
writeln('Zodiak anda Gemini');
if(tgl>=21) then
writeln('Zodiak anda Cancer');
writeln('');
write('Ingin tahu ramalan Gemini/Cancer? ketik(g= gemini, can= cancer) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='g') then
begin
writeln(' Karakter Gemini : ');
writeln('1. Pandai');
writeln('2. Lincah');
writeln('3. Labil');
writeln('4. Gugup');
writeln('5. Jiwa Sosial');
end;
if(ramalan='can')then
begin
writeln(' Karakter Cancer : ');
writeln('1. Setia');
writeln('2. Perhatian');
writeln('3. Labil');
writeln('4. Sentimen');
writeln('5. Ingatan Kuat');
end;
end;
end;
begin
if(bln=7) then
begin
Writeln('Juli');
write('Masukan Tanggal Lahir anda : ');readln(tgl);
if(tgl<=20) then
writeln('Zodiak anda Cancer');
if (tgl>=21)then
writeln('Zodiak anda Leo');
write('Ingin tahu ramalan Cancer/Leo? ketik(can= cancer, l= leo) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='can') then
begin
writeln(' Karakter Cancer : ');
writeln('1. Setia');
writeln('2. Perhatian');
writeln('3. Labil');
writeln('4. Sentimen');
writeln('5. Ingatan Kuat');
end;
if(ramalan='l')then
begin
writeln(' Karakter Leo : ');
writeln('1. Setia ');
writeln('2. Sulit memaafkan');
writeln('3. Labil');
writeln('4. Sentimen');
writeln('5. Ingatan Kuat');
end;
end;
end;
begin
if(bln=8) then
begin
writeln('Agustus');
write('Masukan Tanggal Lahir anda : ');readln(tgl);
if(tgl<=20) then
writeln('Zodiak anda Leo');
if(tgl>=21)then
writeln('Zodiak anda Virgo');
write('Ingin tahu ramalan Leo/Virgo ketik(l= leo, v= virgo) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='l') then
begin
writeln(' Karakter Leo : ');
writeln('1. Setia ');
writeln('2. Sulit memaafkan');
writeln('3. Labil');
writeln('4. Sentimen');
writeln('5. Ingatan Kuat');
end;
if(ramalan='v')then
begin
writeln(' Karakter Virgo : ');
writeln('1. Analis ');
writeln('2. Praktis');
writeln('3. Rajin');
writeln('4. Logis');
writeln('5. Sederhana');
end;
end;
end;
begin
if(bln=9) then
begin
writeln('September');
write('Masukan Tanggal Lahir anda : ');readln(tgl);
if(tgl<=20) then
writeln('Zodiak anda Virgo');
if(tgl>=21)then
writeln('Zodiak anda Libra');
write('Ingin tahu ramalan Virgo/Libra ketik(v= virgo lib= libra) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='v') then
begin
writeln(' Karakter Virgo : ');
writeln('1. Analis ');
writeln('2. Praktis');
writeln('3. Rajin');
writeln('4. Logis');
writeln('5. Sederhana');
end;
if(ramalan='lib')then
begin
writeln(' Karakter Libra : ');
writeln('1. Naluriah ');
writeln('2. Labil');
writeln('3. Adil');
writeln('4. Muka dua');
writeln('5. Mempesona');
end;
end;
end;
begin
if(bln=10) then
begin
writeln('Oktober');
write('Masukan Tanggal Lahir anda : ');readln(tgl);
if(tgl<=20) then
writeln('Zodiak anda Libra');
if(tgl>=21)then
writeln('Zodiak anda Scorpio');
write('Ingin tahu ramalan Libra/Scorpio? ketik(lib= libra, s= scorpio) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='lib') then
begin
writeln(' Karakter Libra : ');
writeln('1. Naluriah ');
writeln('2. Labil');
writeln('3. Adil');
writeln('4. Muka dua');
writeln('5. Mempesona');
end;
if(ramalan='s')then
begin
writeln(' Karakter Scorpio : ');
writeln('1. Gigih ');
writeln('2. Cerdik');
writeln('3. Pendendam');
writeln('4. Tekun');
writeln('5. Pendiam');
end;
end;
end;
begin
if(bln=11) then
begin
writeln('November');
write('Masukan Tanggal Lahir anda : ');readln(tgl);
if(tgl<=20) then
writeln('Zodiak anda Scorpio');
if(tgl>=21)then
writeln('Zodiak anda Sagitarius');
write('Ingin tahu ramalan Scorpio/Sagitarius? ketik(s= scorpio, sag= sagitarius) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='s') then
begin
writeln(' Karakter Scorpio : ');
writeln('1. Gigih ');
writeln('2. Cerdik');
writeln('3. Pendendam');
writeln('4. Tekun');
writeln('5. Pendiam');
end;
if(ramalan='sag')then
begin
writeln(' Karakter Sagitarius : ');
writeln('1. Diplomasi');
writeln('2. Pandangan Luas');
writeln('3. Pandai');
writeln('4. Jiwa Petualang');
writeln('5. Menyukai Kebebasan');
end;
end;
end;
begin
if(bln=12) then
begin
writeln('Desember');
write('Masukan Tanggal Lahir anda : ');readln(tgl);
if(tgl<=20) then
writeln('Zodiak anda Sagitarius');
if(tgl>=21)then
writeln('Zodiak anda Capricorn');
write('Ingin tahu ramalan Sagitarius/Capricorn? ketik(sag= sagitarius, c= capricorn) : ');readln(ramalan);
writeln('-----------------------------------------');
writeln('');
begin
if(ramalan='sag') then
begin
writeln(' Karakter Sagitarius : ');
writeln('1. Diplomasi');
writeln('2. Pandangan Luas');
writeln('3. Pandai');
writeln('4. Jiwa Petualang');
writeln('5. Menyukai Kebebasan');
end;
if(ramalan='c')then
begin
writeln(' Karakter Capricorn : ');
writeln('1. Gengsi tinggi');
writeln('2. Rajin');
writeln('3. Pendiam');
writeln('4. Materialis');
writeln('5. Teguh Pendirian');
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
end;
writeln('');
writeln('Zodiak dan Ramalan ini hanya sekedar hiburan dan ilmu semata');
writeln('jadi jangan di percayai, Percaya hanya kepada Allah Swt.');
readkey;
end.
Selasa, 29 November 2016
Rabu, 02 November 2016
Vb6 Connection to Access
Private Sub cmdbersih_Click()
txtnik.Text = ""
txtnama.Text = ""
txtdivisi.Text = ""
txtjabatan.Text = ""
txtkerja.Text = ""
txtlibur.Text = ""
txtgaji.Text = ""
txtkdlembur.Text = ""
txtjslembur.Text = ""
txtbayar.Text = ""
txttotallembur.Text = ""
txttotalgaji.Text = ""
txtnik.SetFocus
End Sub
Private Sub cmdcari_Click()
Dim Sumber As String
Dim Rs As New Recordset
Dim Cm As New Command
Dim Kunci As String
Kunci = "%" + txtcari + "%"
Sumber = " Select * From Karyawan " & _
" where Nik Like :X or Nama_Karyawan Like :Y "
Cm.ActiveConnection = MYconn
Cm.CommandText = Sumber
Cm.Parameters(0).Value = Kunci
Cm.Parameters(1).Value = Kunci
Set Rs = Cm.Execute
Set MSHFlexGrid1.DataSource = Rs
If Not Rs.EOF Then
Rs.MoveFirst
End If
Dim Z As Integer
Z = 1
While Not Rs.EOF
MSHFlexGrid1.TextMatrix(Z, 1) = Rs!Nik
MSHFlexGrid1.TextMatrix(Z, 2) = Rs!Nama_Karyawan
MSHFlexGrid1.TextMatrix(Z, 3) = Rs!Divisi
MSHFlexGrid1.TextMatrix(Z, 4) = Rs!Jabatan
MSHFlexGrid1.TextMatrix(Z, 5) = Rs!Hari_Kerja
MSHFlexGrid1.TextMatrix(Z, 6) = Rs!Hari_Libur
MSHFlexGrid1.TextMatrix(Z, 7) = Rs!Gaji
Rs.MoveNext
Z = Z + 1
MSHFlexGrid1.AddItem ("")
Wend
End Sub
Private Sub cmdexit_Click()
End
End Sub
Private Sub cmdgaji_Click()
txttotalgaji.Text = Val(txttotallembur.Text) + Val(txtgaji.Text)
End Sub
Private Sub cmdhapus_Click()
Dim Cm As New Command
Dim Sumber As String
Dim Kunci As String
'Kunci = txtnik.text
Kunci = InputBox(" Masukan Nik yang akan dihapus ")
If Kunci = "" Then
MsgBox "Nik belum dimasukan, Masukan Nik : "
Exit Sub
End If
On Error GoTo salah
Sumber = " Delete From Karyawan Where Nik =:NoNik "
Cm.ActiveConnection = MYconn
Cm.CommandText = Sumber
Cm.Parameters(0).Value = Kunci
Cm.Execute
benar:
MsgBox "Data sudah dihapus"
Exit Sub
salah:
MsgBox Err.Description
End Sub
Private Sub cmdrubah_Click()
Dim Cm As New Command
Dim Sumber As String
On Error GoTo salah
Sumber = " Update Karyawan Set Nama_Karyawan =:Nama_Karyawan, Divisi =:Divisi, " & _
" Jabatan =:Jabatan, Hari_Kerja =:Hari_Kerja, Hari_Libur =:Hari_Libur, Gaji =:Gaji " & _
" Where NIK =:NIK "
Cm.ActiveConnection = MYconn
Cm.CommandText = Sumber
Cm.Parameters(0).Value = txtnama
Cm.Parameters(1).Value = txtdivisi
Cm.Parameters(2).Value = txtjabatan
Cm.Parameters(3).Value = txtkerja
Cm.Parameters(4).Value = txtlibur
Cm.Parameters(5).Value = txtgaji
Cm.Parameters(6).Value = txtnik
Cm.Execute
betul:
MsgBox "Data telah dirubah"
Exit Sub
salah:
MsgBox "Masih ada yang salah"
End Sub
Private Sub cmdsimpan_Click()
Dim Sumber As String
Dim Cm As New Command
On Error GoTo salah
If txtnik.Text = "" Then
MsgBox "Masukan Nik dahulu"
End If
Sumber = " Insert into Karyawan Values ( :Nik, :Nama_Karyawan, :Divisi, :Jabatan, :Hari_Kerja, :Hari_Libur, :Gaji ) "
Cm.ActiveConnection = MYconn
Cm.CommandText = Sumber
Cm.Parameters(0).Value = txtnik
Cm.Parameters(1).Value = txtnama
Cm.Parameters(2).Value = txtdivisi
Cm.Parameters(3).Value = txtjabatan
Cm.Parameters(4).Value = txtkerja
Cm.Parameters(5).Value = txtlibur
Cm.Parameters(6).Value = txtgaji
Cm.Execute
betul:
MsgBox "Data sudah di simpan"
Exit Sub
salah:
MsgBox Err.Description
End Sub
Private Sub cmdtampil_Click()
Dim Rs As New Recordset
Dim Cm As New Command
Dim Sumber As String
Dim Kunci As String
'Masukan kunci dalam Input Box
Kunci = txtnik.Text
If Kunci = "" Then
Exit Sub
End If
'Isi sumber dari Tabel PMBPPM dgn Kunci No Formulir
Sumber = " Select * From Karyawan Where NIK =:Kunci "
'Aktifkan Connection String
Cm.ActiveConnection = MYconn
Cm.CommandText = Sumber
'Isi No Formulir dengan Kunci
Cm.Parameters(0).Value = Kunci
'Rs Dilaksanakan
Set Rs = Cm.Execute
If Rs.EOF Then
txtnik.SetFocus
Exit Sub
Else
txtnik.Text = Rs!Nik
txtnama.Text = Rs!Nama_Karyawan
txtdivisi.Text = Rs!Divisi
txtjabatan.Text = Rs!Jabatan
txtkerja.Text = Rs!Hari_Kerja
txtlibur.Text = Rs!Hari_Libur
txtgaji.Text = Rs!Gaji
MsgBox " Tampil Data Ok "
End If
End Sub
Private Sub Form_Load()
MYconn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Program\Ms Access\Data Karyawan.mdb;Persist Security Info=False"
End Sub
Private Sub Option1_Click()
If Option1 = True Then
txttotallembur.Text = 1 * txtbayar.Text
End If
End Sub
Private Sub Option2_Click()
If Option2 = True Then
txttotallembur.Text = 2 * txtbayar.Text
End If
End Sub
Private Sub Option3_Click()
If Option3 = True Then
txttotallembur.Text = 3 * txtbayar.Text
End If
End Sub
Private Sub txtkdlembur_Change()
If txtkdlembur.Text = "ML" Then
txtjslembur.Text = "Malam Lembur"
txtbayar.Text = 70000
Else
If txtkdlembur.Text = "PL" Then
txtjslembur.Text = "Pagi Lembur"
txtbayar.Text = 60000
Else
If txtkdlembur.Text = "LS" Then
txtjslembur.Text = "Long Shift"
txtbayar.Text = 100000
End If
End If
End If
End Sub
Langganan:
Postingan (Atom)