Tugas delphi

10
TUGAS DELPHI (APLIKASI MATEMATIKA DAN BIODATA) OLEH : AJI HARYANTO NIM :09511021 JURUSAN PEND. MATEMATIKA SEKOLAH TINGGI KEGURUAN DAN ILMU PENDIDIKAN STKIP – GARUT 2011

Transcript of Tugas delphi

Page 1: Tugas delphi

  

   

TUGAS DELPHI (APLIKASI MATEMATIKA DAN BIODATA)

 

 OLEH :

AJI HARYANTONIM :09511021

 JURUSAN PEND. MATEMATIKA

SEKOLAH TINGGI KEGURUAN DAN ILMU PENDIDIKANSTKIP – GARUT

2011

Page 2: Tugas delphi
Page 3: Tugas delphi
Page 4: Tugas delphi

LISTING PROGRAM Untuk geometri ruang   procedure TForm2.Button1Click(Sender: TObject); var P,L,T,S,A,R,Volume,Luas:real; begin if combobox1.text='BALOK' then begin P:=strtofloat(edit1.text); L:=strtofloat(edit2.text); T:=strtofloat(edit3.text); Volume:=P*L*T; Luas:=(2*P*T)+(2*P*L)+(2*L*T); edit4.Text:=floattostr(Volume); edit5.Text:=floattostr(Luas); image1.Visible:=true; listbox1.Items.Add('Diketahui : '+ 'Panjang = '+floattostr(P)+ '

Cm'); listbox1.Items.Add(' : '+ 'Lebar =

'+floattostr(L)+ ' Cm'); listbox1.Items.Add(' : '+ 'Tinggi = '+floattostr(T)

+ ' Cm'); listbox1.Items.Add('Jawab :'); listbox1.Items.Add('Volume = P*L*T'); listbox1.Items.Add(' = '+floattostr(Volume)+ ' Cm3'); listbox1.Items.Add('Luas P = (2*P*T)+(2*P*L)+(2*L*T)'); listbox1.Items.Add(' = '+floattostr(Luas)+ ' Cm2'); end else listbox1.Items.Add('Diketahui : '+ 'Alas = '+floattostr(A)+ ' Cm');

listbox1.Items.Add(' : '+ 'Tinggi = '+floattostr(T)+ ' Cm');

listbox1.Items.Add('Jawab :'); listbox1.Items.Add('Volume = 1/2*A*T'); listbox1.Items.Add(' = '+floattostr(Volume)+ ' Cm3'); listbox1.Items.Add('Luas P = (2*1/2)+(A*T)+(A*T)+(A*T)'); listbox1.Items.Add(' = '+floattostr(Luas)+ ' Cm2'); end else if combobox1.text='LIMAS SEGI EMPAT' then begin P:=strtofloat(edit1.text); L:=strtofloat(edit2.text); T:=strtofloat(edit3.text); Volume:=1/3*P*L*T; Luas:=(P*L)+(1/2*P)+(1/2*P)+(1/2*L)+(1/2*L); edit4.Text:=floattostr(Volume); edit5.Text:=floattostr(Luas); image5.Visible:=true; listbox1.Items.Add('Diketahui : '+ 'Panjang = '+floattostr(P)+ '

Cm'); listbox1.Items.Add(' : '+ 'Lebar = '+floattostr(L)

+ ' Cm'); listbox1.Items.Add(' : '+ 'Tinggi = '+floattostr(T)

+ ' Cm'); listbox1.Items.Add('Jawab :'); listbox1.Items.Add('Volume = 1/3*P*L*T'); listbox1.Items.Add(' = '+floattostr(Volume)+ ' Cm3'); listbox1.Items.Add('Luas P = (P*L)+(1/2*P)+(1/2*P)+(1/2*L)

+(1/2*L)'); listbox1.Items.Add(' = '+floattostr(Luas)+ ' Cm2'); end

Page 5: Tugas delphi

else if combobox1.text='KERUCUT' then begin R:=strtofloat(edit7.text); T:=strtofloat(edit3.text); Volume:=1/3*22/7*R*R*T; edit4.Text:=floattostr(Volume); image6.Visible:=true; listbox1.Items.Add('Diketahui : '+

'Jari jari = '+floattostr(R)+ ' Cm'); listbox1.Items.Add(' :

'+ 'Tinggi = '+floattostr(T)+ ' Cm');

listbox1.Items.Add('Jawab :'); listbox1.Items.Add('Volume =

1/3*22/7*R*R*T'); listbox1.Items.Add(' =

'+floattostr(Volume)+ ' Cm3'); end else

if combobox1.text='TABUNG' then begin R:=strtofloat(edit7.text); T:=strtofloat(edit3.text); Volume:=22/7*R*R*T; edit4.Text:=floattostr(Volume); image7.Visible:=true; listbox1.Items.Add('Diketahui : '+ 'Jari jari =

'+floattostr(R)+ ' Cm'); listbox1.Items.Add(' : '+ 'Tinggi =

'+floattostr(T)+ ' Cm'); listbox1.Items.Add('Jawab :'); listbox1.Items.Add('Volume = 22/7*R*R*T'); listbox1.Items.Add(' = '+floattostr(Volume)+ '

Cm3'); end else if combobox1.text='BOLA' then begin R:=strtofloat(edit7.text); Volume:=4/3*22/7*R*R*R; edit4.Text:=floattostr(Volume); image8.Visible:=true; listbox1.Items.Add('Diketahui : '+ 'Jari jari =

'+floattostr(R)+ ' Cm'); listbox1.Items.Add(' : '+ 'Tinggi =

'+floattostr(T)+ ' Cm'); listbox1.Items.Add('Jawab :'); listbox1.Items.Add('Volume = 4/3*22/7*R*R*R');

Page 6: Tugas delphi

listbox1.Items.Add(' = '+floattostr(Volume)+ ' Cm3');

end   end;   procedure

TForm2.Button2Click(Sender: TObject);

begin edit1.Clear; edit2.Clear; edit3.Clear; edit4.Clear; edit5.Clear; edit6.Clear; edit7.Clear; end;

procedure TForm2.FormCreate(Sender: TObject);

begin combobox1.Items.add('BALOK'); combobox1.Items.add('KUBUS'); combobox1.Items.add('PRISMA

SEGITIGA'); combobox1.Items.add('LIMAS SEGI

EMPAT'); combobox1.Items.add('KERUCUT'); combobox1.Items.add('TABUNG'); combobox1.Items.add('BOLA');   end;   end.  

Page 7: Tugas delphi

Untuk biodata 

procedure TForm1.FormCreate(Sender: TObject);

begin Memo1.Clear; Memo2.Clear end;   procedure

TForm1.BitBtn4Click(Sender: TObject);

type tabel_mhs = record nilai_mtk : integer; nilai_bi: integer; nilai_english : integer; nilai_cbt : longint; penguji : String[25]; end;  

var data : array [1..100] of tabel_mhs; i, sum : integer; hasil : real; pil : String;   begin for i:= 1 to 1 do begin

data[i].nilai_mtk:=StrToInt(InputBox('NILAI MATEMATIKA','Masukkan NILAI MATEMATIKA',''));

data[i].nilai_bi:= StrToInt(InputBox('NILAI BAHASA INDONESIA','Masukkan NILAI BAHASA INDONESIA',''));

data[i].nilai_english:= StrToInt(InputBox('NILAI BAHASA INGGRIS','Masukkan NILAI BAHASA INGGRIS',''));

data[i].nilai_cbt:= StrToInt(InputBox('NILAI CBT','Masukkan NILAI CBT',''));

Page 8: Tugas delphi

data[i].penguji:=InputBox('PEMERIKSA ','PETUGAS PEMERIKSA','');

sum:=data[i].nilai_mtk+ data[i].nilai_bi+ data[i].nilai_english+data[i].nilai_cbt;

hasil:=sum/4;   if hasil>=80 then pil:='PENDIDIKAN

MATEMATIKA' else if hasil>=70 then

pil:='PENDIDIKAN BAHASA INGGRIS / PENDIDIKAN BIOLOGI / PENDIDIKAN SASTRA DAN BAHASA INDONESIA '

else if hasil>=65 then pil:='PENDIDIKAN PKN'

else pil:='MAAF TIDAK ADA'; end;   for i:= 1 to 1 do begin Memo2.Lines.append (' ');

Memo2.Lines.append ('Nilai Matematika : '+IntTostr(data[i].nilai_mtk));

Memo2.Lines.append ('Nilai Bahasa Indonesia : '+IntTostr(data[i].nilai_bi));

Memo2.Lines.append ('Nilai Bahasa Inggris : '+IntTostr(data[i].nilai_english));

Memo2.Lines.append ('Nilai CBT SISTEM : '+IntTostr(data[i].nilai_cbt));

Memo2.Lines.append ('PETUGAS PEMERIKSA : '+data[i].penguji);

  Memo2.Lines.append (' '); Memo2.Lines.append ('JURUSAN YANG TERSEDIA

: '+(pil)); Memo2.Lines.append (' '); Memo2.Lines.append ('*** JIKA JURUSAN YANG

ANDA PILIH TIDAK TERDAPAT PADA JURUSAN YANG TERSEDIA MAAF ANDA TIDAK DITERIMA, SILAHKAN MENGIKUTI UJIAN SARINGAN MASUK GELOMBANG BERIKUTNYA. ');

Memo2.Lines.append ('--------------------------------------------------------------------------------------------------');

end;   end;

Page 9: Tugas delphi

procedure TForm1.BitBtn1Click(Sender: TObject); var nama, kota, kontak, alamat, sekolah, jurusan : String; tgl_lahir : String; begin nama:=Edit1.Text; tgl_lahir:=Edit2.Text; kota:=Edit3.Text; kontak:= Edit4.Text; alamat:= Memo1.Text; sekolah:=Edit5.Text; jurusan:=EDIT6.Text;     Memo2.Lines.append ('NAMA : '+nama); Memo2.Lines.append ('TANGGAL LAHIR : '+tgl_lahir); Memo2.Lines.append ('KOTA ASAL : '+kota); Memo2.Lines.append ('KONTAK : '+kontak); Memo2.Lines.append ('DOMISILI : '+alamat); Memo2.Lines.append ('SEKOLAH ASAL : '+sekolah); Memo2.Lines.append ('AMBIL JURUSAN : '+jurusan); label9.Caption:=jurusan;   end;

procedure TForm1.Timer2Timer(Sender: TObject); begin Label10.Caption:=TimeToStr(Time); end;   procedure TForm1.Timer1Timer(Sender: TObject); begin Label10.Caption:=TimeToStr(time); end;   procedure TForm1.BitBtn2Click(Sender: TObject); begin if MessageDlg('HAPUS SEMUA DATA ?', mtConfirmation, [mbYes,mbNo],0)= mrYES   then begin Edit1.Text:=' '; Edit2.Text:=' '; Edit3.Text:=' '; Edit4.Text:=' '; Memo1.Text:=' '; Memo2.Text:=' '; Edit5.Text:=' '; EDIT6.Text:=' '; Label10.Caption:=' '; end; end;

Page 10: Tugas delphi

procedure TForm1.BitBtn5Click(Sender: TObject);

begin if MessageDlg('INPUTKAN DATA BARU ?', mtConfirmation, [mbYes,mbNo],0)= mrYES   then Edit1.Text:=' '; Edit2.Text:=' '; Edit3.Text:=' '; Edit4.Text:=' '; Memo1.Text:=' '; Edit5.Text:=' '; edit6.Text:=' '; Label10.Caption:=' '; end;   end.