Week1,2 Introduction To Programming
Week1,2 Introduction To Programming
What is program?
A set of step-by-step instructions that tells a computer to perform a specific task and to produce the required results. written by the programmer Produced through programming
What is programming?
Programming is a process of designing/ creating a program. It is a communication technique to explain the instructions to the computer. Used to produce the program.
What is Programmer?
A Programmer is a person who designs, writes and test computer programs.
programmers talk to computer using a computer language. Generation of computer languages: - Low Level Language - High Level Languages
8
Low Level Language: 1st : Machine language 2nd : Assembly language : The language structure depends on instruction set/ CPUs architecture.
* low level language enables efficient machine usage but it is difficult to use.
10
11
Machine language
The lowest-level programming language Machine languages are the only languages understood by computers. easily understood by computers, but almost impossible for humans to use (because consist entirely of numbers). Expressed in binary form. Very difficult to use. Lowest level of computer languages. Example:
0101 0101 1000 1010 0001 1101 0000 0001 1100 1010 0001 0000 0000 0101 1111 0100
High-level language
Instruction is written as a series of English-like words. Translator (Compiler/Interpreter) is needed to translate high level language to machine language. It is Machine-Independent. The program can be written and executed on any computer. Example: GAJIBERSIH = GAJIKASAR CUKAI
16
Translation
Computer only understands machine language. Computer program written in assembly language need to translate into machine language before it can be executed. The translation process from assembly language to machine language is done by computer program called assembler.
17
Translation
High level language also need to be translates into machine language before being executed.
The computer program that translates from high level language to machine language is called a compiler or an interpreter.
Bahasa Pengaturcaraan C
C ialah sebuah bahasa pengaturcaraan aras sederhana.
19
Sejarah bahasa C
Berasal dari bahasa BCPL oleh Martin Richards (1967). Ken Thompson mengembangkan bahasa BCPL menjadi bahasa B (1970). Berkembang menjadi bahasa C oleh Dennis Ritchie (1970-an) di Bell Telephone Laboratories Inc. (sekarang adalah AT&T Bell Laboratories). Bahasa C pertama kali digunakan adalah pada komputer Digital Equipment Corporation PDP-11 yang menggunakan sepenuhnya sistem pengoperasian UNIX.
20
22
23
24
Jenis-jenis pengaturcaraan
Structured programming (berstruktur) Modular programming Object-oriented programming (berorentasikan objek)
25
Structured programming
Guna pendekatan "top-down" untuk merekabentuk. Pendekatan top-down bermula dengan gambaran awal dari sistem yang mengandungi butiran minimum tentang bahagian-bahagian yang berbeza. Rekabentuk seterusnya dgn menambah butiran untuk meningkatkan bahagian selanjutnya sehingga selesai rekabentuk. The most popular structured programming languages include C, Ada, and Pascal.
26
Modular programming
Dipecahkan kepada beberapa modul. Break a large program into smaller independances modules.
p/s: find more information and make it as your assignment.
27
Objek Kelas
The most popular object-oriented programming languages include Java, Visual Basic, C#, C++, and Python.
p/s: find more information and make it as your assignment.
28