Menghitung Hambatan


Menghitung Hambatan 1 :

uses wincrt;

var hambatan1,hambatan2,t   : real;
    a : char;
begin
  write ('hambatan 1            : ');readln (hambatan1);
  write ('hambatan 2            : ');readln (hambatan2);
  write ('kode pemasangan (p/s) : ');readln (a);
  if (a='p')or(a='P') then begin
    t := 1/((1/hambatan1)+(1/hambatan2));
  end
  else begin
    t := hambatan1 + hambatan2;
  end;
  writeln;
  writeln ('Hambatan total      :',t:1:2 );
end.

Menghitung Hambatan 2 :

uses wincrt;

var hambatan1,hambatan2,t1,t2   : real;
    a : char;
begin
  write ('hambatan 1            : ');readln (hambatan1);
  write ('hambatan 2            : ');readln (hambatan2);
  write ('kode pemasangan (p/s) : ');readln (a);
  writeln;
  t1 := 1/((1/hambatan1)+(1/hambatan2));
  t2 := hambatan1+hambatan2;
  case a of
    'p': writeln ('total hambatan     : ',t1 :1:2);
    's': writeln ('total hambatan     : ',t2 :1:2);
  end;
end.

Gunawan Setya Putra
[email protected]


Leave a Reply