Anda di halaman 1dari 9

Computer Programming

Dr. Supriyono
How does a computer work?
A computer is just a device which is nothing without:
• Software
• Operator
Software is a result of computer programming. A person
who does computer programming is called programmer.
Programming can be defined as an activity to make
commands in order the computer to be able to do tasks as
being asked by the programmer. Some examples of the
software are Microsoft office, games, Ansys, Catia.
Operator is a person who runs the software.
How does the computer
programming work?
There should be a communication between the computer
and the programmer in order the computer to be able to do
the tasks as the programmer want to. There are two levels
of language for communication i.e.:
• Low level language (machine)
• High level language (fortran, basic, and pascal etc.)
In principal, the computer only understand the low level
one. The avaibility of the high level one needs the availibity
of a compiler which traslate the high level into low level.
However the high level one is easier to be understood due
to the closeness the language to the human language.
Urutan Pemrograman dengan
bahasa tingkat tinggi
• Menulis kode-kode, yang terdiri dari perintah dan
pemberitahuan kepada komputer sesuai kemauan
pemrogram. Kode-kode ini bisa ditulis dengan
sembarang software pengolah kata. Hasilnya disebut
sebagai program sumber (source program)
• Melakukan penerjemahan kedalam bahasa tingkat
rendah. Dilakukan dengan bantuan software yang
disebut compiler (proses kompilasi). Hasil proses
kompilasi adalah file aplikasi (software)
• Menjalankan (melakukan evaluasi) software yang
didapatakan.
Struktur Program Fortran
• Fortran membagi layar editing ke dalam kolom dan baris,
hanya yang digunakan untuk menuliskan kode-kode
adalah kolom 1 sampai kolom 72. (selebihnya tidak
digunakan)
• 72 kolom tsb, dibagai dalam 4 kategori :
– Kolom 1 – 5, digunakan untuk menuliskan kode yang berupa label
(nomor)
– Kolom 7 – 72, digunakan unutk menuliskan kode-kode yang
berupa perintah atau pemberitahuan kpd komputer (statement)
– Kolom 6, digunakan untuk tempat indikasi sambungan dari baris
sebelumnya
– Jika kolom 1 kita tulis huruf C atau c, maka kita membekukan
baris yang bersangkutan (apa yang ditulis dalam baris tsb tidak
diperhatikan oleh komputer)
Beberapa Definisi
• Konstanta (nilai) :
– Bilangan (bisa dilakukan operasi aritmatika +, -, x, :) dibedakan
konstanta real (ada desimalnya) dan konstanta bulat (integer)
– Karakter (tidak bisa dioperasikan dengan operasi aritmatika)
• Variable (tempat untuk menyimpan konstanta), nama variable boleh
lebih dari satu karakter dng ketentuan :
– Max 6 karakter, karakter I harus huruf, tidak menggunakan karakter
kosong (spasi).
– Jika karakter I dari salah satu huruf I, J, K, L, M, N maka variable tsb
adalah variable untuk nilai integer.
• Operator :
– Aritmatika (untuk operasi aritmatika) berlaku herarki pengerjaan
sebagaimana dalam matematika (Kode dalam fortran +, -, *, /)
– Hubungan (Kode .LT. (lebih kecil), .LE. (lebih kecil sama dengan), .GT.
(lebih besar), .GE. (lebih besar sama dengan), .EQ. (sama dengan),
.NE. (tdak sama dengan)
FORTRAN Code Structure
FORTRAN uses column number 1 to number 72
to build a FORTRAN code that can be explained
as:
• The first column, when we place character “C”
or “c” or “*” in the first column meaning that the
line is comment.
• The first to the fifth columns are for labelling.
• The sixth column is for junction indication.
• The seventh to seventy second are for writing
FORTRAN statement.
Some definition in FORTRAN code
• Constant
– Real
– Integer
• Variable
– Real
– Integer
• Operator
– Arithmetic operator
– Relationship operator
Simple FORTRAN Code

Anda mungkin juga menyukai