KEMBAR78
Domaći-Lazarus Ts Zadatak 1.: Radiobutton | PDF | Teaching Methods & Materials
0% found this document useful (0 votes)
69 views6 pages

Domaći-Lazarus Ts Zadatak 1.: Radiobutton

The document contains 4 programming tasks that use different Delphi controls: 1. Radio buttons are used to display different formulas for calculating the perimeter and area of shapes (triangle, square, rectangle, rhombus, trapezoid) based on which radio button is selected. 2. Radio buttons are used to calculate the total resistance of resistors in either a series or parallel circuit based on which radio button is selected. 3. A radio group is used to select different music genres, displaying the genre name and artist in labels and an edit box based on the selected radio group item. 4. A combo box is used to display different categories paired with examples when the combo box selection changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
69 views6 pages

Domaći-Lazarus Ts Zadatak 1.: Radiobutton

The document contains 4 programming tasks that use different Delphi controls: 1. Radio buttons are used to display different formulas for calculating the perimeter and area of shapes (triangle, square, rectangle, rhombus, trapezoid) based on which radio button is selected. 2. Radio buttons are used to calculate the total resistance of resistors in either a series or parallel circuit based on which radio button is selected. 3. A radio group is used to select different music genres, displaying the genre name and artist in labels and an edit box based on the selected radio group item. 4. A combo box is used to display different categories paired with examples when the combo box selection changes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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