Dalam Bahasa Pascal:
uses crt;
Var
X:Integer;
Y:Integer;
Z:Integer;
T:Integer;
K:Integer;
Begin
CLRSCR;
WRITELN('Jumlah Karyawan: ');READLN(X);
K:=0;
For Y := 1 to X do
Begin
WRITELN();
WRITELN('Jam Kerja Karyawan: ');READLN(Z);
If Z > 7 Then
Begin
T:=10*7+(15*(z-7));
End
Else
T:=10*Z;
WRITE('Total Gaji: ',T*1000);
K:=K+T;
End;
WRITELN();
WRITELN('Total Gaji Karyawan: ',k*1000);
READLN();
End.
Dalam Bahasa Algoritma:
Var
X:Integer
Y:Integer
Z:Integer
T:Integer
K:Integer
Begin
CLRSCR;
Output('Jumlah Karyawan: ')Input(X)
K-->0
For Y -->1 to X do
Begin
Output()
Output('Jam Kerja Karyawan: ')Input(Z)
If Z > 7 Then
Begin
T-->10*7+(15*(z-7))
End
Else
T-->10*Z
Output'Total Gaji: ',T*1000)
K-->K+T
End;
Output()
Output('Total Gaji Karyawan: ',k*1000)
End Algoritma
Var
X:Integer;
Y:Integer;
Z:Integer;
T:Integer;
K:Integer;
Begin
CLRSCR;
WRITELN('Jumlah Karyawan: ');READLN(X);
K:=0;
For Y := 1 to X do
Begin
WRITELN();
WRITELN('Jam Kerja Karyawan: ');READLN(Z);
If Z > 7 Then
Begin
T:=10*7+(15*(z-7));
End
Else
T:=10*Z;
WRITE('Total Gaji: ',T*1000);
K:=K+T;
End;
WRITELN();
WRITELN('Total Gaji Karyawan: ',k*1000);
READLN();
End.
Dalam Bahasa Algoritma:
Var
X:Integer
Y:Integer
Z:Integer
T:Integer
K:Integer
Begin
CLRSCR;
Output('Jumlah Karyawan: ')Input(X)
K-->0
For Y -->1 to X do
Begin
Output()
Output('Jam Kerja Karyawan: ')Input(Z)
If Z > 7 Then
Begin
T-->10*7+(15*(z-7))
End
Else
T-->10*Z
Output'Total Gaji: ',T*1000)
K-->K+T
End;
Output()
Output('Total Gaji Karyawan: ',k*1000)
End Algoritma
Tidak ada komentar:
Posting Komentar