KEMBAR78
Algorithm and Programming (Sequential Structure) | PDF
Adam Mukharil Bachtiar
English Class
Informatics Engineering 2011
Algorithms and Programming
Sequential Structure
Steps of the Day
Let’s Start
Definition Characteristic Exercises
Definition
Definition
DefinitionofSequential
Structure
• The simplest and basic structure in algorithm.
• Instruction was processed in sequential way
(top down approach).
Characteristics of
Sequential Structure
All about Sequential Structure
Characteristics
• Each instruction was 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
Case of Employee’s Salary
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
Algorithm of Employee’s Salary
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)
pajak0.1*gaji_pokok
tunjangan0.2*gaji_pokok
gajigaji_pokok+tunjangan-pajak
jml_gajigaji*jml_karyawan
output(‘Pajak perorang= Rp. ‘,pajak)
output(‘Tunjangan perorang= Rp. ‘,tunjangan)
output(Gaji ‘,jml_karyawan,’ orang karyawan= Rp. ‘,jml_gaji)
Pascal Code of Employee’s Salary
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
program Gaji_Karyawan;
uses crt;
var
gaji_pokok,gaji,jml_gaji:real;
pajak:real;
tunjangan:real;
jml_karyawan:integer;
begin
write('Masukan jumlah karyawan: ');readln(jml_karyawan);
write('Masukan gaji pokok : ');readln(gaji_pokok);
pajak:=0.1*gaji_pokok;
tunjangan:=0.2*gaji_pokok;
gaji:=gaji_pokok+tunjangan-pajak;
jml_gaji:=gaji*jml_karyawan;
clrscr();{untuk membersihkan layar}
writeln('Pajak perorang = Rp. ',pajak:0:2);
writeln('Tunjangan perorang = Rp. ',tunjangan:0:2);
writeln('Gaji ',jml_karyawan,' orang = Rp. ',jml_gaji:0:2);
writeln();
write('Tekan sembarang tombol untuk menutup...');
readkey();
end.
Collection of Exercises
Exercises of Sequential Search
Exercise 1
Create the algorithm and pascal code to:
• Around and area for 4 2-dimensional space
• Around and area for 3 3-dimensional space.
Exercise 2
Create the algorithm and pascal code to show
curriculum vitae in paragraph style.
Contact Person:
Adam Mukharil Bachtiar
Informatics Engineering UNIKOM
Jalan Dipati Ukur Nomor. 112-114 Bandung 40132
Email: adfbipotter@gmail.com
Blog: http://adfbipotter.wordpress.com
Copyright © Adam Mukharil Bachtiar 2011

Algorithm and Programming (Sequential Structure)

  • 1.
    Adam Mukharil Bachtiar EnglishClass Informatics Engineering 2011 Algorithms and Programming Sequential Structure
  • 2.
    Steps of theDay Let’s Start Definition Characteristic Exercises
  • 3.
  • 4.
    DefinitionofSequential Structure • The simplestand basic structure in algorithm. • Instruction was processed in sequential way (top down approach).
  • 5.
  • 6.
    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) pajak0.1*gaji_pokok tunjangan0.2*gaji_pokok gajigaji_pokok+tunjangan-pajak jml_gajigaji*jml_karyawan output(‘Pajak perorang= Rp. ‘,pajak) output(‘Tunjangan perorang= Rp. ‘,tunjangan) output(Gaji ‘,jml_karyawan,’ orang karyawan= Rp. ‘,jml_gaji)
  • 10.
    Pascal Code ofEmployee’s Salary 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 program Gaji_Karyawan; uses crt; var gaji_pokok,gaji,jml_gaji:real; pajak:real; tunjangan:real; jml_karyawan:integer; begin write('Masukan jumlah karyawan: ');readln(jml_karyawan); write('Masukan gaji pokok : ');readln(gaji_pokok); pajak:=0.1*gaji_pokok; tunjangan:=0.2*gaji_pokok; gaji:=gaji_pokok+tunjangan-pajak; jml_gaji:=gaji*jml_karyawan; clrscr();{untuk membersihkan layar} writeln('Pajak perorang = Rp. ',pajak:0:2); writeln('Tunjangan perorang = Rp. ',tunjangan:0:2); writeln('Gaji ',jml_karyawan,' orang = Rp. ',jml_gaji:0:2); writeln(); write('Tekan sembarang tombol untuk menutup...'); readkey(); end.
  • 11.
  • 12.
    Exercise 1 Create thealgorithm and pascal code to: • Around and area for 4 2-dimensional space • Around and area for 3 3-dimensional space.
  • 13.
    Exercise 2 Create thealgorithm and pascal code to show curriculum vitae in paragraph style.
  • 14.
    Contact Person: Adam MukharilBachtiar Informatics Engineering UNIKOM Jalan Dipati Ukur Nomor. 112-114 Bandung 40132 Email: adfbipotter@gmail.com Blog: http://adfbipotter.wordpress.com Copyright © Adam Mukharil Bachtiar 2011