Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Domaći-Lazarus TS

Zadatak 1.RadioButton
procedure TForm1.TrougaoChange(Sender: TObject);

begin

if trougao.Checked then

begin

Obim.Text:='a+b+c';

Povrsina.Text:='a*h/2'

end;

end;

procedure TForm1.KvadratChange(Sender: TObject);

begin

if kvadrat.Checked then

begin

Obim.Text:='4*a';

Povrsina.Text:='a*a'

end;

end;

procedure TForm1.PravougaonikChange(Sender: TObject);

begin

if pravougaonik.Checked then

begin

Obim.Text:='2*a+2*b';

Povrsina.Text:='a*b'

end;

end;
procedure TForm1.RombChange(Sender: TObject);

begin

if romb.Checked then

begin

Obim.Text:='4*a';

Povrsina.Text:='d1*d2/2'

end;

end;

procedure TForm1.TrapezChange(Sender: TObject);

begin

if trapez.Checked then

begin

Obim.Text:='a+b+c+d';

Povrsina.Text:='(a+b)/2*h'

end;

end;

end.

Zadatak 2.RadioButton

procedure TRedno.RacunajClick(Sender: TObject);

var

R1,R2,R:real;

begin

R1 := StrToFloat(otporR1.text);

R2 := StrToFloat(otporR2.text);

if redno.checked then

R:= R1 + R2;
if paralelno.checked then

R:= 1/(1/R1 + 1/R2);

otporR.text := FloatToStr(R);

end;

end.

Zadatak 3.
RadioGroup

procedure TForm1.RadioGroup1Click(Sender: TObject);

begin

case RadioGroup1.ItemIndex of

0: begin

label1.Caption:='Rock';

edit1.Text:='Billy Idol'

end;

1: begin

label1.Caption:='Pop';

edit1.Text:='Madonna'

end;

2: begin

label1.Caption:='Jazz';

edit1.Text:='John Coltrane'

end;

3: begin

label1.Caption:='House';
edit1.Text:='Todd Terry'

end;

4: begin

label1.Caption:='Metal';

edit1.Text:='Metallica'

end;

5: begin

label1.Caption:='Punk';

edit1.Text:='Ramones'

end;

6: begin

label1.Caption:='Folk';

edit1.Text:='Jony Mitchel'

end;

7: begin

label1.Caption:='Klasika';

edit1.Text:='Mozart'

end;

end;

end;

end.
Zadatak 4. ComboBox
procedure

TForm1.ComboBox1Change(Sender: TObject);

begin

case ComboBox1.ItemIndex of

0: label1.caption:= 'Pop' + #13 + 'Madona';

1: label1.caption:= 'Blake Edwards' + #13 + 'Breakfast at Tiffanys';

2: label1.caption:= 'Ivo Andric' + #13 + 'Na Drini cuprija';

3: label1.caption:= 'Kosarka' + #13 + 'Lebron James';

4: label1.caption:= 'Holandija' + #13 + 'Amsterdam';

end;

end;

You might also like