Escolar Documentos
Profissional Documentos
Cultura Documentos
interface
uses
type
TForm1 = class(TForm)
Label1: TLabel;
LABEL3: TLabel;
Label3: TLabel;
LABEL5: TLabel;
Label5: TLabel;
LABEL7: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
RadioGroup1: TRadioGroup;
RadioGroup2: TRadioGroup;
RadioGroup3: TRadioGroup;
Button1: TButton;
Edit1: TEdit;
Label10: TLabel;
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
GELANG1,GELANG2,GELANG3:integer;
implementation
{$R *.dfm}
begin
if radiogroup1.ItemIndex=0 then
begin
LABEL3.color:=clBlack;
GELANG1:=0;
end;
if radiogroup1.ItemIndex=1 then
begin
LABEL3.color:=$00264380;
GELANG1 :=10;
end;
if radiogroup1.ItemIndex=2 then
begin
LABEL3.color:=clRed;
GELANG1 :=20;
end;
if radiogroup1.ItemIndex=3 then
begin
LABEL3.color:=$000098FD;
GELANG1 :=30;
end;
if radiogroup1.ItemIndex=4 then
begin
LABEL3.color:=clYellow;
GELANG1 :=40;
end;
if radiogroup1.ItemIndex=5 then
begin
LABEL3.color:=clgreen;
GELANG1 :=50;
end;
if radiogroup1.ItemIndex=6 then
begin
LABEL3.color:=clBlue;
GELANG1 :=60;
end;
if radiogroup1.ItemIndex=7 then
begin
LABEL3.color:=clPurple;
GELANG1 :=70;
end;
if radiogroup1.ItemIndex=8 then
begin
LABEL3.color:=clGray;
GELANG1 :=80;
end;
if radiogroup1.ItemIndex=9 then
begin
LABEL3.color:=clwhite;
GELANG1 :=90;
end;
end;
begin
if radiogroup2.ItemIndex=0 then
begin
LABEL5.color:=clBlack;
GELANG2:=0;
end;
if radiogroup2.ItemIndex=1 then
begin
LABEL5.color:=$00264380;
GELANG2 :=1;
end;
if radiogroup2.ItemIndex=2 then
begin
LABEL5.color:=clRed;
GELANG2 :=2;
end;
if radiogroup2.ItemIndex=3 then
begin
LABEL5.color:=$000098FD;
GELANG2 :=3;
end;
if radiogroup2.ItemIndex=4 then
begin
LABEL5.color:=clYellow;
GELANG2 :=4;
end;
if radiogroup2.ItemIndex=5 then
begin
LABEL5.color:=clgreen;
GELANG2 :=5;
end;
if radiogroup2.ItemIndex=6 then
begin
LABEL5.color:=clBlue;
GELANG2 :=6;
end;
if radiogroup2.ItemIndex=7 then
begin
LABEL5.color:=clPurple;
GELANG2 :=7;
end;
if radiogroup2.ItemIndex=8 then
begin
LABEL5.color:=clGray;
GELANG2 :=8;
end;
if radiogroup2.ItemIndex=9 then
begin
LABEL5.color:=clwhite;
GELANG2 :=9;
end;
end;
begin
if radiogroup3.ItemIndex=0 then
begin
LABEL7.color:=clBlack;
GELANG3:=1;
end;
if radiogroup3.ItemIndex=1 then
begin
LABEL7.color:=$00264380;
GELANG3 :=10;
end;
if radiogroup3.ItemIndex=2 then
begin
LABEL7.color:=clRed;
GELANG3 :=100;
end;
if radiogroup3.ItemIndex=3 then
begin
LABEL7.color:=$000098FD;
GELANG3 :=1000;
end;
if radiogroup3.ItemIndex=4 then
begin
LABEL7.color:=clYellow;
GELANG3 :=10000;
end;
if radiogroup3.ItemIndex=5 then
begin
LABEL7.color:=clgreen;
GELANG3 :=100000;
end;
if radiogroup3.ItemIndex=6 then
begin
LABEL7.color:=clBlue;
GELANG3 :=1000000;
end;
if radiogroup3.ItemIndex=7 then
begin
LABEL7.color:=clPurple;
GELANG3 :=10000000;
end;
if radiogroup3.ItemIndex=8 then
begin
LABEL7.color:=ClGray;
GELANG3 :=100000000;
end;
if radiogroup3.ItemIndex=9 then
begin
LABEL7.color:=clWhite;
GELANG3 :=1000000000;
end;
end;
begin
nilaiR:=((GELANG1+GELANG2)*GELANG3);
begin
nilaiR1:=nilaiR;
label10.Caption:='OHM' ;
end;
if nilaiR >=1000 then
begin
nilaiR1:=nilaiR/1000;
label10.Caption:='K OHM';
end;
begin
nilaiR1:=nilaiR/1000000;
label10.Caption:='M OHM';
end;
edit1.Text:=floattostr(nilaiR1);
end;
end.