SlideShare ist ein Scribd-Unternehmen logo
1 von 52
Downloaden Sie, um offline zu lesen
Adam Mukharil Bachtiar
English Class
Informatics Engineering 2011
Algorithms and Programming
Introduction of Dev Pascal,
Data Type, Value, and Identifier
Steps of the Day
Let’s Start
Dev Pascal Data Type
Value and
Identifier
Dev Pascal
Definition and Instalation
DefinitionofDEVPascal
An IDE (Integrated Development
Environment) for PASCAL language that was
built by BLOODSHEED. It’s Freeware.
HowtoMakeaProgramin
DEVPascal?
Step 1
Open Dev Pascal application
Step 2
Make a New File or New Project
Step 3
Choose Console Application  OK
Step 4
Give a name to project
(Name can contain space character)
WARNING: Name of project should be same with name of its
folder. One folder is only for one project (in my class)
Step 5
Save the project in the folder that had been provided
Step 6
If you have done with all steps correctly, you will get this
view on your computer
Step 7
Save this file in the same folder that contains the project
Step 8
Give an icon to your project. Click Project  Project
options in menu bar.
WARNING: Icon is an mandatory thing in Dev Pascal project
Step 9
Click Load icon then choose an icon that you want. Click
OK to finish this step.
Step 10
Type pascal syntax then click CTRL + F10 or click
Execute  Compile and Run to see the result of this program.
Algorithm Notation
VS
Pascal Notation
Example of Algorithm Notation
1
2
3
4
5
6
7
8
9
10
11
12
13
{ ini adalah notasi algoritma } komentar
Algoritma judul_algoritma
{I.S.: diisi keadaan yang terjadi di awal algoritma}
{F.S.: diisi keadaan yang terjadi di akhir algoritma}
Kamus/Deklarasi:
{diisi pendefinisian konstanta}
{diisi deklarasi variabel beserta tipe data}
Algoritma/Deskripsi:
{diisi dengan input, proses, dan output}
Example of Pascal Notation
1
2
3
4
5
6
7
8
9
10
11
{ ini adalah notasi pascal}  komentar
program judul_program;
var
{diisi pendefinisian konstanta}
{diisi deklarasi variabel beserta tipe data}
begin
{diisi dengan input, proses, dan output}
end.
Algorithm Notation VS Pascal Notation
Num ALGORITHM PASCAL
1 Kamus: var
2 Algoritma:
begin
end.
3 input(variabel)
readln(variabel);
read(variabel);
4 output(‘...........................’)
write(‘................................’);
atau
writeln(‘..............................’);
5 output(‘.................’,variabel)
write(‘.............................’,variabel);
atau
writeln(‘...........................’,variabel);
6 output(variabel)
write(variabel);
atau
writeln(variabel);
7  :=
Your First Pascal Program
1
2
3
4
5
6
7
8
9
10
11
12
program Program_Pertama;
uses crt; {pemanggilan unit crt untuk readkey()}
begin
writeln(‘Selamat Datang’);
write(‘Di’);
writeln(‘ UNIKOM’);
writeln(‘Bandung’);
writeln();
write(‘Tekan sembarang tombol untuk menutup.’);
readkey();
end.
Exchange value with additional variabel (Algorithm)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Algoritma Tukar_Nilai
{I.S.: Nilai variabel a dan b dimasukkan oleh user}
{F.S.: Menampilkan hasil penukaran nilai variabel a dan b}
Kamus:
a,b: integer
bantu:integer
Algoritma:
output(‘Masukkan nilai a: ‘)
input(a)
output(‘Masukkan nilai b: ‘)
input(b)
bantua
ab
bbantu
output(‘Nilai a sekarang : ‘,a)
output(‘Nilai b sekarang : ‘,b)
Exchange value with additional variabel (Pascal)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
program Tukar_Nilai;
uses crt; {pemanggilan unit crt untuk readkey()}
var
a,b:integer;
bantu:integer;
begin
write(‘Masukan nilai a: ‘); readln(a);
write(‘Masukan nilai b: ‘); readln(b);
bantu:=a;
a:=b;
b:=bantu;
writeln(‘Nilai a sekarang: ‘,a);
writeln(‘Nilai b sekarang: ‘,b);
readkey();
end.
Exchange value without additional variabel (Algorithm)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Algoritma Tukar_Nilai
{I.S.: Nilai variabel a dan b dimasukkan oleh user}
{F.S.: Menampilkan hasil penukaran nilai variabel a dan b}
Kamus:
a,b: integer
Algoritma:
input(a,b)
aa+b
ba-b
aa-b
output(‘Nilai a sekarang : ‘,a)
output(‘Nilai b sekarang : ‘,b)
Exchange value with additional variabel (Pascal)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
program Tukar_Nilai;
uses crt; {pemanggilan unit crt untuk readkey()}
var
a,b:integer;
begin
write(‘Masukan nilai a: ‘); readln(a);
write(‘Masukan nilai b: ‘); readln(b);
a:=a+b;
b:=a-b;
a:=a-b;
writeln(‘Nilai a sekarang: ‘,a);
writeln(‘Nilai b sekarang: ‘,b);
readkey();
end.
Data Type
Data Type in Algorithm and Pascal
KindofDataTypes
• Tipe Data Dasar (Predefined Data Type)
• Tipe Data Bentukan (user-defined Data Type)
Predefined Data Type
• Have been known in daily
life.
• Such as: logic number,
integer, real number,
characters, and string.
Logic Number
• Name : boolean
• Value : True and False
• Can be initialized as 0 or 1 in
number.
Operation in Logic Number
x not x
true false
false true
x y x and y x or y x xor y
true true true true false
true false false true true
false true false true true
false false false false false
Integer
• Name : integer
• Value : - (~) until + (~) (without .)
• Arithmetic : +, -, *, /, div, mod
• Comparison : < , ≤ , > , ≥ , = , ≠.
Real
• Name : real
• Value : - (~) until + (~)
• Arithmetic : +, -, *, /
• Comparison : < , ≤ , > , ≥ , = , ≠.
Characters
• Name : char
• Value : all alphabet, decimal number,
punctuation mark, arithmetic
operator, and ASCII
• Comparation : < , ≤ , > , ≥ , = , ≠.
String
• Name : String
• Value : set of characters (flanked
with ’ ’)
• Comparison : < , ≤ , > , ≥ , = , ≠.
User-defined Data Type
• Predefined Data Type that
was named with a new one.
• Structure type.
Modified Predefined Data Type
• Reason : Easy to remember and High readibility.
• Keyword : type
• Example:
type
pecahan : real { : can be replaced with = }
Structure Type
• Reason : set of data that have different data type.
• Example :
type
Mahasiswa = record
< NIM : integer, {0..9}
Nama : string, {‘A’..’Z’, ‘a’..’z’}
Nilai : real {0..100} >
Structure Type
• If mhs1 is mahasiswa type, so to access each field in mhs1
can be done with these statement:
a. mhs1.NIM
b. mhs1.Nama
c. mhs1.Nilai
Data Type in Algorithm and Pascal
Algorithm Pascal Range in Pascal
boolean boolean true dan false
integer byte 0..255
shortint -128..127
word 0..65535
integer -32768..32767
longint -2147483648..2147483647
real real 2.9 x 10-39..1.7 x 1038
single 1.5 x 10-45..3.4 x 1038
double 5.0 x 10-324..1.7 x 10308
extended 3.4 x 10-4932..1.1 x 104932
char char
string string
string[n]
type
varrecord:record
< field1:type1,
field2:type2,
...
field_n:type_n >
type
varrecord=record
field1:type1;
field2:type2;
...
field_n:type_n;
end;
Operator in Algorithm and Pascal
Algorithm Pascal
+ +
- -
* *
/ /
div div
mod mod
Algorithm Pascal
< <
≤ <=
> >
≥ >=
= =
≠ <>
Algorithm Pascal
not not
and and
or or
xor xor
Algorithm Pascal
type type
const const
true true
false false
{ komentar} { komentar }
(* komentar *)
Identifier
Definition, Rules and Expression
DefinitionofIdentifier
Identifiers can be used to access something in
algorithm or program.
DefinitionofIdentifier
AREA
KAMUS
Konstanta
Tipe Bentukan
Variabel
Rules of Naming
• Name must be started with alphabet.
• Upper case and lower case are the same thing in Pascal (case
insensitive)  Suggest: should be consistent.
• Name only consists of alphabet, number, and underscore.
• Identifier can’t contain arithmetic operator, relational, and
punctuation mark, space.
• Choose the name that easy to remember.
Variable VS Constants
• Variable and Constants was used to store the value in
memory.
• Variable can change the value in the middle of running time.
• Constants will keep the value permanently while running
time.
Variable VS Constants
Variable Declaration
Constants Declaration
Nama_variabel:tipe_data
Example: x,y:integer
type
const nama_konstanta = nilai_konstanta
Contoh:
type
const phi =3.14
Math and Algorithm Notation
• Prefix  *79 , *+a/bc-d*ef
• Infix  7*9 , a+b/c*d-e*f
• Postfix  68* , abc/+def*-*
Math and Algorithm Notation
• luas=
1
2
(alas.tinggi)  luas1/2*(alas*tinggi)
• a=
10𝑏+3𝑐
5𝑑
 a (10*b + 3*c)/(5*d)
EXERCISE
Exercise 1
Declare user-defined data type for cases:
• SIM
• KTP
• Lecturer Data
Exercise 2
Convert these math notations into algorithm notations:
• m=
𝑎−𝑏
3𝑎𝑐
(1-
𝑏𝑐𝑑
𝑓𝑔ℎ
)
• x=
−𝑏+2𝑐2+4𝑎𝑏𝑐
2𝑐(3𝑎+4𝑐)
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

Weitere ähnliche Inhalte

Was ist angesagt?

Basic c++ programs
Basic c++ programsBasic c++ programs
Basic c++ programsharman kaur
 
Scala categorytheory
Scala categorytheoryScala categorytheory
Scala categorytheoryKnoldus Inc.
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentalsumar78600
 
JavaScript - Chapter 4 - Types and Statements
 JavaScript - Chapter 4 - Types and Statements JavaScript - Chapter 4 - Types and Statements
JavaScript - Chapter 4 - Types and StatementsWebStackAcademy
 
What\'s New in C# 4.0
What\'s New in C# 4.0What\'s New in C# 4.0
What\'s New in C# 4.0Eyal Vardi
 
Loops and functions in r
Loops and functions in rLoops and functions in r
Loops and functions in rmanikanta361
 
Python Programming - IX. On Randomness
Python Programming - IX. On RandomnessPython Programming - IX. On Randomness
Python Programming - IX. On RandomnessRanel Padon
 
Scala is java8.next()
Scala is java8.next()Scala is java8.next()
Scala is java8.next()daewon jeong
 
C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8Christian Nagel
 
5. using variables, data, expressions and constants
5. using variables, data, expressions and constants5. using variables, data, expressions and constants
5. using variables, data, expressions and constantsCtOlaf
 
Python Programming - II. The Basics
Python Programming - II. The BasicsPython Programming - II. The Basics
Python Programming - II. The BasicsRanel Padon
 
Latest C Interview Questions and Answers
Latest C Interview Questions and AnswersLatest C Interview Questions and Answers
Latest C Interview Questions and AnswersDaisyWatson5
 
Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Sumant Tambe
 
FP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondFP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondMario Fusco
 

Was ist angesagt? (20)

Basic c++ programs
Basic c++ programsBasic c++ programs
Basic c++ programs
 
Meta Object Protocols
Meta Object ProtocolsMeta Object Protocols
Meta Object Protocols
 
Clojure basics
Clojure basicsClojure basics
Clojure basics
 
Scala categorytheory
Scala categorytheoryScala categorytheory
Scala categorytheory
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
JavaScript - Chapter 4 - Types and Statements
 JavaScript - Chapter 4 - Types and Statements JavaScript - Chapter 4 - Types and Statements
JavaScript - Chapter 4 - Types and Statements
 
Kotlin
KotlinKotlin
Kotlin
 
What\'s New in C# 4.0
What\'s New in C# 4.0What\'s New in C# 4.0
What\'s New in C# 4.0
 
Loops and functions in r
Loops and functions in rLoops and functions in r
Loops and functions in r
 
C++11
C++11C++11
C++11
 
Python Programming - IX. On Randomness
Python Programming - IX. On RandomnessPython Programming - IX. On Randomness
Python Programming - IX. On Randomness
 
Scala is java8.next()
Scala is java8.next()Scala is java8.next()
Scala is java8.next()
 
Knolx session
Knolx sessionKnolx session
Knolx session
 
C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8C# 7.x What's new and what's coming with C# 8
C# 7.x What's new and what's coming with C# 8
 
5. using variables, data, expressions and constants
5. using variables, data, expressions and constants5. using variables, data, expressions and constants
5. using variables, data, expressions and constants
 
Python Programming - II. The Basics
Python Programming - II. The BasicsPython Programming - II. The Basics
Python Programming - II. The Basics
 
Java gets a closure
Java gets a closureJava gets a closure
Java gets a closure
 
Latest C Interview Questions and Answers
Latest C Interview Questions and AnswersLatest C Interview Questions and Answers
Latest C Interview Questions and Answers
 
Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)Fun with Lambdas: C++14 Style (part 2)
Fun with Lambdas: C++14 Style (part 2)
 
FP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyondFP in Java - Project Lambda and beyond
FP in Java - Project Lambda and beyond
 

Andere mochten auch

Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)Adam Mukharil Bachtiar
 
Function procedure c6 c7
Function procedure  c6 c7Function procedure  c6 c7
Function procedure c6 c7Omar Al-Sabek
 
Algorithm and Programming (Sequential Structure)
Algorithm and Programming (Sequential Structure)Algorithm and Programming (Sequential Structure)
Algorithm and Programming (Sequential Structure)Adam Mukharil Bachtiar
 
Internet, Email, Operating System Concepts2
Internet, Email, Operating System Concepts2Internet, Email, Operating System Concepts2
Internet, Email, Operating System Concepts2Nisa Peek
 
Gimp-manimaran
Gimp-manimaranGimp-manimaran
Gimp-manimaranrmanimaran
 
Functions in python
Functions in pythonFunctions in python
Functions in pythonIlian Iliev
 
Data Management (Data Mining Klasifikasi)
Data Management (Data Mining Klasifikasi)Data Management (Data Mining Klasifikasi)
Data Management (Data Mining Klasifikasi)Adam Mukharil Bachtiar
 
Ligtas at Responsableng Paggamit ng Computer, Internet at Email
Ligtas at Responsableng Paggamit ng Computer, Internet at EmailLigtas at Responsableng Paggamit ng Computer, Internet at Email
Ligtas at Responsableng Paggamit ng Computer, Internet at EmailMarie Jaja Tan Roa
 
G.C.E O/L ICT Short Notes Grade-11
G.C.E O/L ICT Short Notes Grade-11G.C.E O/L ICT Short Notes Grade-11
G.C.E O/L ICT Short Notes Grade-11Mahesh Kodituwakku
 
Pascal tutorial
Pascal tutorialPascal tutorial
Pascal tutorialhidden__
 
Pascal Programming Language
Pascal Programming LanguagePascal Programming Language
Pascal Programming LanguageReham AlBlehid
 
Presentation1.Ppt Email And Internet
Presentation1.Ppt Email And InternetPresentation1.Ppt Email And Internet
Presentation1.Ppt Email And Internetaggregate
 
Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)Adam Mukharil Bachtiar
 
Pascal Programming Session 1
Pascal Programming Session 1Pascal Programming Session 1
Pascal Programming Session 1Ashesh R
 
Introduction of Cloud computing
Introduction of Cloud computingIntroduction of Cloud computing
Introduction of Cloud computingRkrishna Mishra
 

Andere mochten auch (19)

Pascal programming language
Pascal programming languagePascal programming language
Pascal programming language
 
Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)Algorithm and Programming (Looping Structure)
Algorithm and Programming (Looping Structure)
 
Function procedure c6 c7
Function procedure  c6 c7Function procedure  c6 c7
Function procedure c6 c7
 
Arrays c4 c5
Arrays c4 c5Arrays c4 c5
Arrays c4 c5
 
Algorithm and Programming (Sequential Structure)
Algorithm and Programming (Sequential Structure)Algorithm and Programming (Sequential Structure)
Algorithm and Programming (Sequential Structure)
 
Internet, Email, Operating System Concepts2
Internet, Email, Operating System Concepts2Internet, Email, Operating System Concepts2
Internet, Email, Operating System Concepts2
 
Gimp-manimaran
Gimp-manimaranGimp-manimaran
Gimp-manimaran
 
Functions in python
Functions in pythonFunctions in python
Functions in python
 
Data Management (Data Mining Klasifikasi)
Data Management (Data Mining Klasifikasi)Data Management (Data Mining Klasifikasi)
Data Management (Data Mining Klasifikasi)
 
Ligtas at Responsableng Paggamit ng Computer, Internet at Email
Ligtas at Responsableng Paggamit ng Computer, Internet at EmailLigtas at Responsableng Paggamit ng Computer, Internet at Email
Ligtas at Responsableng Paggamit ng Computer, Internet at Email
 
G.C.E O/L ICT Short Notes Grade-11
G.C.E O/L ICT Short Notes Grade-11G.C.E O/L ICT Short Notes Grade-11
G.C.E O/L ICT Short Notes Grade-11
 
Pascal tutorial
Pascal tutorialPascal tutorial
Pascal tutorial
 
Algorithm and Programming (Sorting)
Algorithm and Programming (Sorting)Algorithm and Programming (Sorting)
Algorithm and Programming (Sorting)
 
Pascal Programming Language
Pascal Programming LanguagePascal Programming Language
Pascal Programming Language
 
Algorithm and Programming (Searching)
Algorithm and Programming (Searching)Algorithm and Programming (Searching)
Algorithm and Programming (Searching)
 
Presentation1.Ppt Email And Internet
Presentation1.Ppt Email And InternetPresentation1.Ppt Email And Internet
Presentation1.Ppt Email And Internet
 
Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)
 
Pascal Programming Session 1
Pascal Programming Session 1Pascal Programming Session 1
Pascal Programming Session 1
 
Introduction of Cloud computing
Introduction of Cloud computingIntroduction of Cloud computing
Introduction of Cloud computing
 

Ähnlich wie Algorithm and Programming (Introduction of dev pascal, data type, value, and identifier)

Decaf language specification
Decaf language specificationDecaf language specification
Decaf language specificationSami Said
 
Don't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax TreesDon't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax TreesJamund Ferguson
 
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...Data Con LA
 
Spark schema for free with David Szakallas
Spark schema for free with David SzakallasSpark schema for free with David Szakallas
Spark schema for free with David SzakallasDatabricks
 
Taxonomy of Scala
Taxonomy of ScalaTaxonomy of Scala
Taxonomy of Scalashinolajla
 
Applying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing SpeedApplying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing SpeedPascal-Louis Perez
 
Scala for Java Programmers
Scala for Java ProgrammersScala for Java Programmers
Scala for Java ProgrammersEric Pederson
 
The operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerThe operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerAndrey Karpov
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side JavascriptJulie Iskander
 
Esprima - What is that
Esprima - What is thatEsprima - What is that
Esprima - What is thatAbhijeet Pawar
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentalsHCMUTE
 
Introduction to Python , Overview
Introduction to Python , OverviewIntroduction to Python , Overview
Introduction to Python , OverviewNB Veeresh
 
Basics of Javascript
Basics of JavascriptBasics of Javascript
Basics of JavascriptUniverse41
 
Scala Parser Combinators - Scalapeno Lightning Talk
Scala Parser Combinators - Scalapeno Lightning TalkScala Parser Combinators - Scalapeno Lightning Talk
Scala Parser Combinators - Scalapeno Lightning TalkLior Schejter
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayUtkarsh Sengar
 

Ähnlich wie Algorithm and Programming (Introduction of dev pascal, data type, value, and identifier) (20)

Bioinformatics v2014 wim_vancriekinge
Bioinformatics v2014 wim_vancriekingeBioinformatics v2014 wim_vancriekinge
Bioinformatics v2014 wim_vancriekinge
 
Decaf language specification
Decaf language specificationDecaf language specification
Decaf language specification
 
Don't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax TreesDon't Be Afraid of Abstract Syntax Trees
Don't Be Afraid of Abstract Syntax Trees
 
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
 
Spark schema for free with David Szakallas
Spark schema for free with David SzakallasSpark schema for free with David Szakallas
Spark schema for free with David Szakallas
 
Taxonomy of Scala
Taxonomy of ScalaTaxonomy of Scala
Taxonomy of Scala
 
Applying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing SpeedApplying Compiler Techniques to Iterate At Blazing Speed
Applying Compiler Techniques to Iterate At Blazing Speed
 
Scala for Java Programmers
Scala for Java ProgrammersScala for Java Programmers
Scala for Java Programmers
 
C
CC
C
 
The operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzerThe operation principles of PVS-Studio static code analyzer
The operation principles of PVS-Studio static code analyzer
 
Introduction to Client-Side Javascript
Introduction to Client-Side JavascriptIntroduction to Client-Side Javascript
Introduction to Client-Side Javascript
 
Esprima - What is that
Esprima - What is thatEsprima - What is that
Esprima - What is that
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
Introduction to Python , Overview
Introduction to Python , OverviewIntroduction to Python , Overview
Introduction to Python , Overview
 
Aggregate.pptx
Aggregate.pptxAggregate.pptx
Aggregate.pptx
 
Basics of Javascript
Basics of JavascriptBasics of Javascript
Basics of Javascript
 
Understanding linq
Understanding linqUnderstanding linq
Understanding linq
 
Scala in Places API
Scala in Places APIScala in Places API
Scala in Places API
 
Scala Parser Combinators - Scalapeno Lightning Talk
Scala Parser Combinators - Scalapeno Lightning TalkScala Parser Combinators - Scalapeno Lightning Talk
Scala Parser Combinators - Scalapeno Lightning Talk
 
Python Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard WayPython Workshop - Learn Python the Hard Way
Python Workshop - Learn Python the Hard Way
 

Mehr von Adam Mukharil Bachtiar

Materi 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdfMateri 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdfAdam Mukharil Bachtiar
 
Clean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful NamesClean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful NamesAdam Mukharil Bachtiar
 
Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)Adam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic ProgrammingAnalisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic ProgrammingAdam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and ConquerAnalisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and ConquerAdam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma GreedyAnalisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma GreedyAdam Mukharil Bachtiar
 
Analisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute ForceAnalisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute ForceAdam Mukharil Bachtiar
 
Analisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute ForceAnalisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute ForceAdam Mukharil Bachtiar
 
Analisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi AlgoritmaAnalisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi AlgoritmaAdam Mukharil Bachtiar
 
Analisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi AsimptotikAnalisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi AsimptotikAdam Mukharil Bachtiar
 
Analisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi AsimptotikAnalisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi AsimptotikAdam Mukharil Bachtiar
 

Mehr von Adam Mukharil Bachtiar (20)

Materi 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdfMateri 8 - Data Mining Association Rule.pdf
Materi 8 - Data Mining Association Rule.pdf
 
Clean Code - Formatting Code
Clean Code - Formatting CodeClean Code - Formatting Code
Clean Code - Formatting Code
 
Clean Code - Clean Comments
Clean Code - Clean CommentsClean Code - Clean Comments
Clean Code - Clean Comments
 
Clean Method
Clean MethodClean Method
Clean Method
 
Clean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful NamesClean Code and Design Pattern - Meaningful Names
Clean Code and Design Pattern - Meaningful Names
 
Model Driven Software Development
Model Driven Software DevelopmentModel Driven Software Development
Model Driven Software Development
 
Scrum: How to Implement
Scrum: How to ImplementScrum: How to Implement
Scrum: How to Implement
 
Pengujian Perangkat Lunak
Pengujian Perangkat LunakPengujian Perangkat Lunak
Pengujian Perangkat Lunak
 
Data Mining Clustering
Data Mining ClusteringData Mining Clustering
Data Mining Clustering
 
Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)Data Mining Klasifikasi (Updated 30 Desember 2020)
Data Mining Klasifikasi (Updated 30 Desember 2020)
 
Analisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic ProgrammingAnalisis Algoritma - Strategi Algoritma Dynamic Programming
Analisis Algoritma - Strategi Algoritma Dynamic Programming
 
Analisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and ConquerAnalisis Algoritma - Strategi Algoritma Divide and Conquer
Analisis Algoritma - Strategi Algoritma Divide and Conquer
 
Analisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma GreedyAnalisis Algoritma - Strategi Algoritma Greedy
Analisis Algoritma - Strategi Algoritma Greedy
 
Analisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute ForceAnalisis Algoritma - Penerapan Strategi Algoritma Brute Force
Analisis Algoritma - Penerapan Strategi Algoritma Brute Force
 
Analisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute ForceAnalisis Algoritma - Strategi Algoritma Brute Force
Analisis Algoritma - Strategi Algoritma Brute Force
 
Analisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi AlgoritmaAnalisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
Analisis Algoritma - Kelas-kelas Dasar Efisiensi Algoritma
 
Analisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi AsimptotikAnalisis Algoritma - Teorema Notasi Asimptotik
Analisis Algoritma - Teorema Notasi Asimptotik
 
Analisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi AsimptotikAnalisis Algoritma - Notasi Asimptotik
Analisis Algoritma - Notasi Asimptotik
 
Activity Diagram
Activity DiagramActivity Diagram
Activity Diagram
 
UML dan Use Case View
UML dan Use Case ViewUML dan Use Case View
UML dan Use Case View
 

Kürzlich hochgeladen

Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 

Kürzlich hochgeladen (20)

Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 

Algorithm and Programming (Introduction of dev pascal, data type, value, and identifier)

  • 1. Adam Mukharil Bachtiar English Class Informatics Engineering 2011 Algorithms and Programming Introduction of Dev Pascal, Data Type, Value, and Identifier
  • 2. Steps of the Day Let’s Start Dev Pascal Data Type Value and Identifier
  • 4. DefinitionofDEVPascal An IDE (Integrated Development Environment) for PASCAL language that was built by BLOODSHEED. It’s Freeware.
  • 6. Step 1 Open Dev Pascal application
  • 7. Step 2 Make a New File or New Project
  • 8. Step 3 Choose Console Application  OK
  • 9. Step 4 Give a name to project (Name can contain space character) WARNING: Name of project should be same with name of its folder. One folder is only for one project (in my class)
  • 10. Step 5 Save the project in the folder that had been provided
  • 11. Step 6 If you have done with all steps correctly, you will get this view on your computer
  • 12. Step 7 Save this file in the same folder that contains the project
  • 13. Step 8 Give an icon to your project. Click Project  Project options in menu bar. WARNING: Icon is an mandatory thing in Dev Pascal project
  • 14. Step 9 Click Load icon then choose an icon that you want. Click OK to finish this step.
  • 15. Step 10 Type pascal syntax then click CTRL + F10 or click Execute  Compile and Run to see the result of this program.
  • 17. Example of Algorithm Notation 1 2 3 4 5 6 7 8 9 10 11 12 13 { ini adalah notasi algoritma } komentar Algoritma judul_algoritma {I.S.: diisi keadaan yang terjadi di awal algoritma} {F.S.: diisi keadaan yang terjadi di akhir algoritma} Kamus/Deklarasi: {diisi pendefinisian konstanta} {diisi deklarasi variabel beserta tipe data} Algoritma/Deskripsi: {diisi dengan input, proses, dan output}
  • 18. Example of Pascal Notation 1 2 3 4 5 6 7 8 9 10 11 { ini adalah notasi pascal}  komentar program judul_program; var {diisi pendefinisian konstanta} {diisi deklarasi variabel beserta tipe data} begin {diisi dengan input, proses, dan output} end.
  • 19. Algorithm Notation VS Pascal Notation Num ALGORITHM PASCAL 1 Kamus: var 2 Algoritma: begin end. 3 input(variabel) readln(variabel); read(variabel); 4 output(‘...........................’) write(‘................................’); atau writeln(‘..............................’); 5 output(‘.................’,variabel) write(‘.............................’,variabel); atau writeln(‘...........................’,variabel); 6 output(variabel) write(variabel); atau writeln(variabel); 7  :=
  • 20. Your First Pascal Program 1 2 3 4 5 6 7 8 9 10 11 12 program Program_Pertama; uses crt; {pemanggilan unit crt untuk readkey()} begin writeln(‘Selamat Datang’); write(‘Di’); writeln(‘ UNIKOM’); writeln(‘Bandung’); writeln(); write(‘Tekan sembarang tombol untuk menutup.’); readkey(); end.
  • 21.
  • 22. Exchange value with additional variabel (Algorithm) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 Algoritma Tukar_Nilai {I.S.: Nilai variabel a dan b dimasukkan oleh user} {F.S.: Menampilkan hasil penukaran nilai variabel a dan b} Kamus: a,b: integer bantu:integer Algoritma: output(‘Masukkan nilai a: ‘) input(a) output(‘Masukkan nilai b: ‘) input(b) bantua ab bbantu output(‘Nilai a sekarang : ‘,a) output(‘Nilai b sekarang : ‘,b)
  • 23. Exchange value with additional variabel (Pascal) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 program Tukar_Nilai; uses crt; {pemanggilan unit crt untuk readkey()} var a,b:integer; bantu:integer; begin write(‘Masukan nilai a: ‘); readln(a); write(‘Masukan nilai b: ‘); readln(b); bantu:=a; a:=b; b:=bantu; writeln(‘Nilai a sekarang: ‘,a); writeln(‘Nilai b sekarang: ‘,b); readkey(); end.
  • 24. Exchange value without additional variabel (Algorithm) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Algoritma Tukar_Nilai {I.S.: Nilai variabel a dan b dimasukkan oleh user} {F.S.: Menampilkan hasil penukaran nilai variabel a dan b} Kamus: a,b: integer Algoritma: input(a,b) aa+b ba-b aa-b output(‘Nilai a sekarang : ‘,a) output(‘Nilai b sekarang : ‘,b)
  • 25. Exchange value with additional variabel (Pascal) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 program Tukar_Nilai; uses crt; {pemanggilan unit crt untuk readkey()} var a,b:integer; begin write(‘Masukan nilai a: ‘); readln(a); write(‘Masukan nilai b: ‘); readln(b); a:=a+b; b:=a-b; a:=a-b; writeln(‘Nilai a sekarang: ‘,a); writeln(‘Nilai b sekarang: ‘,b); readkey(); end.
  • 26. Data Type Data Type in Algorithm and Pascal
  • 27. KindofDataTypes • Tipe Data Dasar (Predefined Data Type) • Tipe Data Bentukan (user-defined Data Type)
  • 28. Predefined Data Type • Have been known in daily life. • Such as: logic number, integer, real number, characters, and string.
  • 29. Logic Number • Name : boolean • Value : True and False • Can be initialized as 0 or 1 in number.
  • 30. Operation in Logic Number x not x true false false true x y x and y x or y x xor y true true true true false true false false true true false true false true true false false false false false
  • 31. Integer • Name : integer • Value : - (~) until + (~) (without .) • Arithmetic : +, -, *, /, div, mod • Comparison : < , ≤ , > , ≥ , = , ≠.
  • 32. Real • Name : real • Value : - (~) until + (~) • Arithmetic : +, -, *, / • Comparison : < , ≤ , > , ≥ , = , ≠.
  • 33. Characters • Name : char • Value : all alphabet, decimal number, punctuation mark, arithmetic operator, and ASCII • Comparation : < , ≤ , > , ≥ , = , ≠.
  • 34. String • Name : String • Value : set of characters (flanked with ’ ’) • Comparison : < , ≤ , > , ≥ , = , ≠.
  • 35. User-defined Data Type • Predefined Data Type that was named with a new one. • Structure type.
  • 36. Modified Predefined Data Type • Reason : Easy to remember and High readibility. • Keyword : type • Example: type pecahan : real { : can be replaced with = }
  • 37. Structure Type • Reason : set of data that have different data type. • Example : type Mahasiswa = record < NIM : integer, {0..9} Nama : string, {‘A’..’Z’, ‘a’..’z’} Nilai : real {0..100} >
  • 38. Structure Type • If mhs1 is mahasiswa type, so to access each field in mhs1 can be done with these statement: a. mhs1.NIM b. mhs1.Nama c. mhs1.Nilai
  • 39. Data Type in Algorithm and Pascal Algorithm Pascal Range in Pascal boolean boolean true dan false integer byte 0..255 shortint -128..127 word 0..65535 integer -32768..32767 longint -2147483648..2147483647 real real 2.9 x 10-39..1.7 x 1038 single 1.5 x 10-45..3.4 x 1038 double 5.0 x 10-324..1.7 x 10308 extended 3.4 x 10-4932..1.1 x 104932 char char string string string[n] type varrecord:record < field1:type1, field2:type2, ... field_n:type_n > type varrecord=record field1:type1; field2:type2; ... field_n:type_n; end;
  • 40. Operator in Algorithm and Pascal Algorithm Pascal + + - - * * / / div div mod mod Algorithm Pascal < < ≤ <= > > ≥ >= = = ≠ <> Algorithm Pascal not not and and or or xor xor Algorithm Pascal type type const const true true false false { komentar} { komentar } (* komentar *)
  • 42. DefinitionofIdentifier Identifiers can be used to access something in algorithm or program.
  • 44. Rules of Naming • Name must be started with alphabet. • Upper case and lower case are the same thing in Pascal (case insensitive)  Suggest: should be consistent. • Name only consists of alphabet, number, and underscore. • Identifier can’t contain arithmetic operator, relational, and punctuation mark, space. • Choose the name that easy to remember.
  • 45. Variable VS Constants • Variable and Constants was used to store the value in memory. • Variable can change the value in the middle of running time. • Constants will keep the value permanently while running time.
  • 46. Variable VS Constants Variable Declaration Constants Declaration Nama_variabel:tipe_data Example: x,y:integer type const nama_konstanta = nilai_konstanta Contoh: type const phi =3.14
  • 47. Math and Algorithm Notation • Prefix  *79 , *+a/bc-d*ef • Infix  7*9 , a+b/c*d-e*f • Postfix  68* , abc/+def*-*
  • 48. Math and Algorithm Notation • luas= 1 2 (alas.tinggi)  luas1/2*(alas*tinggi) • a= 10𝑏+3𝑐 5𝑑  a (10*b + 3*c)/(5*d)
  • 50. Exercise 1 Declare user-defined data type for cases: • SIM • KTP • Lecturer Data
  • 51. Exercise 2 Convert these math notations into algorithm notations: • m= 𝑎−𝑏 3𝑎𝑐 (1- 𝑏𝑐𝑑 𝑓𝑔ℎ ) • x= −𝑏+2𝑐2+4𝑎𝑏𝑐 2𝑐(3𝑎+4𝑐)
  • 52. 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