Tugas Power Point Individu Delphi Fenti_09511041_2a

19
Tugas Program komputer menggunakan array Diajukan untuk memenuhi salah satu tugas UAS TAKE HOME Dosen : Dedy Sofyan, M.Pd. Oleh: Fenti Nuraida 09511041 2A

description

PROGRAM DELPHI ARRAY

Transcript of Tugas Power Point Individu Delphi Fenti_09511041_2a

Page 1: Tugas Power Point Individu Delphi Fenti_09511041_2a

TugasProgram komputer menggunakan array

Diajukan untuk memenuhi salah satu tugas UAS TAKE HOMEDosen : Dedy Sofyan, M.Pd.

Oleh:

Fenti Nuraida09511041

2A

Page 2: Tugas Power Point Individu Delphi Fenti_09511041_2a

MENU

BIODATA

BILANGAN PRIMA

TIMER

PENUTUP

Page 3: Tugas Power Point Individu Delphi Fenti_09511041_2a

TAMPILAN MENU

Page 4: Tugas Power Point Individu Delphi Fenti_09511041_2a

procedure TForm1.mAuTaUbUkAYuk1Click(Sender: TObject);beginform6.ProgressBar1.Position := 0;form6.Timer1.Enabled := true;form6.Visible:=true;//form1.visible:=false;

//form3.Show;end;

procedure TForm1.mUlAiiiblAjArrr1Click(Sender: TObject);begin//form4.show;form6.ProgressBar1.Position := 0;form6.Timer2.Enabled := true;form6.Visible:=true;

end;

procedure TForm1.oUtaJaDecHhE1Click(Sender: TObject);beginapplication.terminate;end;

var

Form1: TForm1;

implementation

uses U_biodataku, U_BILANGANPRIMA, U_penutup,U_Loading;

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);

begin

mediaplayer1.Play;

end;

procedure TForm1.gEtOut1Click(Sender: TObject);

begin

form6.ProgressBar1.Position := 0;

form6.Timer3.Enabled := true;

form6.Visible:=true;

//form5.show

end;

Listing Program Main Menu

Page 5: Tugas Power Point Individu Delphi Fenti_09511041_2a

procedure TForm1.Timer3Timer(Sender: TObject);beginif label8.Font.Color=clyellow thenlabel8.Font.Color:=clfuchsiaelselabel8.Font.Color:=clyellow;

end;

end.

procedure TForm1.Timer1Timer(Sender: TObject);

begin

if label2.Font.Color=clyellow then

label2.Font.Color:=clfuchsia

else

label2.Font.Color:=clyellow;

end;

procedure TForm1.Timer2Timer(Sender: TObject);

begin

if label7.Font.Color=clyellow then

label7.Font.Color:=clfuchsia

else

label7.Font.Color:=clyellow;

end;

Page 6: Tugas Power Point Individu Delphi Fenti_09511041_2a

TAMPILAN BIODATA SEBELUM DI RUN

Page 7: Tugas Power Point Individu Delphi Fenti_09511041_2a

TAMPILAN BIODATA SESUDAH DI RUN

Page 8: Tugas Power Point Individu Delphi Fenti_09511041_2a

Listing Biodata

procedure TForm3.Button1Click(Sender: TObject);vars:string;p,i:integer;nama:array[1..2]of string;adikke:array[1..2]of string;ttl:array[1..2]of string;hoby:array[1..2]of string;sekolah:array[1..2]of string;

beginlistbox1.items.clear;s:=inputbox('loop','jumlah perulangan','');p:=strtoint(s);stringgrid1.cells[0,0]:='nama';stringgrid1.cells[1,0]:='adik ke';stringgrid1.cells[2,0]:='ttl';stringgrid1.cells[3,0]:='hoby';stringgrid1.cells[4,0]:='sekolah';for i:=1 to p do

beginnama[i]:=inputbox('ID','nama','');adikke[i]:=inputbox('ID','adik ke','');ttl[i]:=inputbox('ID','ttl','');hoby[i]:=inputbox('ID','hoby','');sekolah[i]:=inputbox('ID','sekolah','');listbox1.items.add(inttostr(i)+'.'+nama[i]);listbox1.items.add(' '+adikke[i]);listbox1.items.add(' '+ttl[i]);listbox1.items.add(' '+hoby[i]);listbox1.items.add(' '+sekolah[i];

Page 9: Tugas Power Point Individu Delphi Fenti_09511041_2a

stringgrid1.cells[0,i]:=nama[i];stringgrid1.cells[1,i]:=adikke[i];stringgrid1.cells[2,i]:=ttl[i];stringgrid1.cells[3,i]:=hoby[i];stringgrid1.cells[4,i]:=sekolah[i];

end;

end;

procedure TForm3.Button2Click(Sender: TObject);beginform3.Visible:=false;end;

procedure TForm3.Timer1Timer(Sender: TObject);beginif image1.left <> 0 thenbegin;image1.left := image1.left - 1;

endelse begintimer1.Enabled := false;

endend;

procedure TForm3.Timer2Timer(Sender: TObject);beginif groupbox1.left <> 0 thenbegin;groupbox1.left := groupbox1.left - 1;

endelse begintimer2.Enabled := false;

endend;procedure TForm3.Timer3Timer(Sender: TObject);beginif labeL9.Font.Color=clblue thenlabel9.Font.Color:=clyellowelselabel9.Font.Color:=clblue;

end;

end.

Page 10: Tugas Power Point Individu Delphi Fenti_09511041_2a

TAMPILAN BILANGAN PRIMA SEBELUM DI RUN

Page 11: Tugas Power Point Individu Delphi Fenti_09511041_2a

TAMPILAN BILANGAN PRIMA SESUDAH DI RUN

Page 12: Tugas Power Point Individu Delphi Fenti_09511041_2a

Listing Programnya Adalah :procedure TForm4.BitBtn1Click(Sender: TObject);beginEditN.Text:='';edit1.Text:='';ListBox1.clear;Listbox2.Clear;end;procedure TForm4.BitBtn2Click(Sender: TObject);beginclose;end;

procedure TForm4.RadioButton1Click(Sender: TObject);var n,i,s:integer;p:boolean;begin//jika bil priman:=StrToInt(EditN.Text);i:=2;P:=True ;//jika bukan bil primawhile (i<=n-1) and p dobegins:=n mod i;if s=0 then p:=false;i:=i+1;end;

if p=truethen Edit1.Text:='ya'else Edit1.Text:='bukan';if n=1then Edit1.Text:='bukan';if n=0then Edit1.Text:='bukan';end;

procedure TForm4.RadioButton2Click(Sender: TObject);var i,a,b,c,d:integer; p:boolean;//memunculkanbanyaknya bil prima sebanyak di edit nbegina:=StrToInt(Editn.Text);For b:=2 to 1000 dobegini:=2;p:=true;while(i<=b-1)and p dobeginc:=b mod i;if c=0 then p:=false;i:=i+1;end;if Listbox1.Items.count<a thenif p=true thenListbox1.Items.Add('Bilangan Prima ke-'+IntToStr(Listbox1.Items.count+1)+'='+IntToStr(b));end;

Page 13: Tugas Power Point Individu Delphi Fenti_09511041_2a

procedure TForm4.RadioButton3Click(Sender: TObject);

Var i,n,m,s:Integer;

p:boolean;

//memunculkan bilangan prima kurang dari editn

begin

m:=StrToInt(EditN.Text);

ListBox2.Items.Add(IntToStr(2));

for n:=3 to m do

begin

i:=2;

p:=true;

while(i<n-1) and p do

begin

s:=n mod i;

if s=0 then p:=false;

i:=i+1;

end;

if p=true

then ListBox2.Items.Add(IntToStr(n));

end;

end;

procedure TForm4.Timer1Timer(Sender: TObject);beginif label1.Font.Color=clred thenlabel1.Font.Color:=clgreenelselabel1.Font.Color:=clred;end;

procedure TForm4.Timer2Timer(Sender: TObject);beginif label2.Font.Color=clred thenlabel2.Font.Color:=clblueelselabel2.Font.Color:=clred;end;

procedure TForm4.Timer3Timer(Sender: TObject);beginif label3.Font.Color=clred thenlabel3.Font.Color:=clyellowelselabel3.Font.Color:=clred;end;end.

Page 14: Tugas Power Point Individu Delphi Fenti_09511041_2a

TAMPILAN LOADING SEBELUM DI RUN

Page 15: Tugas Power Point Individu Delphi Fenti_09511041_2a

TAMPILAN LOADING SETELAH DI RUN

Page 16: Tugas Power Point Individu Delphi Fenti_09511041_2a

procedure TForm6.Timer1Timer(Sender: TObject);

begin

if progressbar1.Position <> 100 then

progressbar1.Position := progressbar1.Position +1

else

begin

timer1.Enabled := false;

form6.Close;

form3.visible:=true;

end;

end;

Listing Programnya :

procedure TForm6.Timer2Timer(Sender: TObject);beginif progressbar1.Position <> 100 thenprogressbar1.Position := progressbar1.Position +1elsebegintimer2.Enabled := false;form6.Close;form4.visible:=true;end;

end;

procedure TForm6.Timer3Timer(Sender: TObject);beginif progressbar1.Position <> 100 thenprogressbar1.Position := progressbar1.Position +1elsebegintimer3.Enabled := false;form6.Close;form5.visible:=true;end;

end;

end.

Page 17: Tugas Power Point Individu Delphi Fenti_09511041_2a

TAMPILAN PENUTUP SEBELUM DI RUN

Page 18: Tugas Power Point Individu Delphi Fenti_09511041_2a

TAMPILAN PENUTUP SETELAH DI RUN

Page 19: Tugas Power Point Individu Delphi Fenti_09511041_2a

procedure TForm5.BitBtn1Click(Sender: TObject);

begin

close;

end;

procedure TForm5.Timer1Timer(Sender: TObject);

begin

if label1.Font.Color=clgreen then

label1.Font.Color:=clyellow

else

label1.Font.Color:=clgreen;

end;

procedure TForm5.Timer2Timer(Sender: TObject);

begin

if label5.Font.Color=clgreen then

label5.Font.Color:=clyellow

else

label5.Font.Color:=clgreen;

end;