This document covers sequential structures in algorithms, detailing characteristics, definitions, and exercises in programming for employee salary calculations. It includes an algorithm and Pascal code demonstrating how to compute salaries, tax, and allowances based on user input. Additionally, it features exercises for creating algorithms for geometric computations and formatting CVs.
Characteristics
• Each instructionwas processed one by one.
• No repeateance in each instruction.
• The last instruction is the end of algorithm.
• Sequence of instructions is same with
sequence of instructions in Algorithm
8.
Case of Employee’sSalary
UNIKOM has n employees with salary asumptions such as:
• Salary of each employee was equal each other.
• Salary was counted by basic salary + allowance - tax .
• The tax is 10 % from basic salary before added by
allowance.
• Allowance is 20% from basic salary.
• Basic salary can be changed.
Calculate salary that UNIKOM must be pay to all employees,
detail of tax, and detail of allowance for each employee
9.
Algorithm of Employee’sSalary
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Algoritma Gaji_Karyawan
{I.S: Jumlah karyawan dan Gaji pokok diinput oleh user}
{F.S: Menampilkan gaji, pajak, dan tunjangan karyawan}
Deklarasi:
gaji_pokok,gaji,jml_gaji:real
pajak:real
tunjangan:real
jml_karyawan:integer
Algoritma:
input(jml_karyawan,gaji_pokok)
pajak0.1*gaji_pokok
tunjangan0.2*gaji_pokok
gajigaji_pokok+tunjangan-pajak
jml_gajigaji*jml_karyawan
output(‘Pajak perorang= Rp. ‘,pajak)
output(‘Tunjangan perorang= Rp. ‘,tunjangan)
output(Gaji ‘,jml_karyawan,’ orang karyawan= Rp. ‘,jml_gaji)