FLOWCHART
PROGRAM
program menghitung_daya_jangkar_dan_arus_generator_sinkron;
uses crt;
function pjangkar(f_ea, f_ig, f_cospi: real): real;
var result: real;
begin
result := f_ea * f_ig * f_cospi;
pjangkar := result;
end;
function igenerator(f_s, f_v: real): real;
var result: real;
begin
result := f_s / f_v;
igenerator := result;
end;
var
s, v, ea, ig, cospi: real;
pilihan: string;
begin
clrscr;
writeln('PRORAM MENHITUNG DAYA JANGKAR & ARUS GENERATOR SINKRON');
writeln;
writeln;
writeln('1. Menghitung daya jangkar');
writeln('2. Menghitung arus generator sinkron');
write('masukkan pilihan : ');
readln(pilihan);
if (pilihan = '1') then
begin
write('masukkan nilai ea : ');
readln(ea);
write('masukkan nilai ig : ');
readln(ig);
write('masukkan nilai cos phi : ');
readln(cospi);
writeln('nilai Pjangkar (daya jangkar) : ', pjangkar(ea, ig, cospi):2:3, ' watt');
end
else if (pilihan = '2') then
begin
write('masukkan nilai s : ');
readln(s);
write('masukkan nilai v : ');
readln(v);
writeln('nilai Ig (arus generator) : ', igenerator(s, v):2:3, ' ampere');
end
else
begin
writeln('salah input');
end;
readln;
end.