Chapter 1 - Intro To Programming Language 20182019
Chapter 1 - Intro To Programming Language 20182019
Foundation Computing
II
Chapter 1
Introduction to Computer
and Programming
Teh FaradillaAbdul Rahman
Language PUSAT ASASI
UiTM Dengkil
2 11/6/20
Learning Outcomes :
Overview of computer and its application
Computer components
Evolution of Programming Languages
To describe the function of programming
languages.
To explore existing programming languages.
Introduction to C Programming
The Programming Process using C programming
3
Introduction
Computer – an electronic devices consist of hardware
and software and perform tasks and produce the output
Categories of Computers
Individuals
Desktop : PC, iMac
Personal Digital Assistant (PDA)
Laptop
Organizations
Supercomputers
Mainframes
Servers
Minicomputers
5
Computer Components
Computer
Hardware Software
• Any part of the computer • The set of computer
that can be physically touch programs that enables the
• Input and Output devices hardware to perform
different tasks.
• Application
• System
6
Computer Software
Software
Computer Hardware
Coding Schemes
Each printable and non-printable character is represented by
unique number in memory.
Encoding – method to encode character to unique number
program1
Error free
Compiled Executable
Programmer file (*.exe)
writes program & debug
Understanding
Software Programming
Some tasks are complex
Requires creative thought
Requires human touch
Some tasks are candidates for automation
Works with electronic information
Repetitive
Follows a series of clear steps
13
The Importance of Programming
A career in programming offers
Plentiful jobs
Strong salaries
Telecommuting is often easy to arrange
Computer programs exist for many tasks
Programming necessary when no existing
software for task
14
15
Successfully Create
complete miniprograms
projects (macros)
Basic
knowledge of
programming
Create
Add custom
custom commands
applications
16
Generation of Programming
language
Machine language
Assembly language
High Level language
Compiler
machine language program
Computers understand
People understand
binary(11011)
‘program’
18
Machine Language
Binary number codes understood by a specific CPU.
Lowest level of language
Represent data and program instructions as 1s and 0s
The only language that computer directly understand
(Do not require translator)
Not convenient to read and use.
First generation language
Machine - dependent
Example:
To calculate wages = rates * hours in machine
language:
100100 010001 //Load
100110 010010 //Multiply
100010 010011 //Store
20 11/6/20
Assembly Language
Second generation language
Developed to replace 1s and 0s use in machine language.
Use mnemonic codes : abbreviations that easy to remember
Requires a translator to translate the assembly program into
machine language ( assembler).
Difficult to learn
Machine-dependent
Assembly Language
Low level language.
Unique to particular computer.
Use mnemonics symbols. E.g. “MULT” –Multiply
Easier to understand.
A program is written in source code (text file) and translated
into machine language by an assembler.
22 11/6/20
Comparison
A Machine-language Program Fragment and Its Assembly-
Language Equivalent
Memory Address Machine-Language Assembly-Language
Instructions Instructions
Visual Basic
28
Visual Basic
Advantages of Visual Basic
– Prototyping is form of rapid application
development (RAD)
– Developers create prototype then
generate system documents
– RAD is alternative to waterfall approach
– Used to build Windows applications
29
C and C++
Provides higher-level
programming features
Java
Programmers use various languages when information
needs to be collected from networked computers
– Java is an object-oriented language
• Is a good choice for these applications
• Popular because it uses a large set of existing
classes
• Classes exist for many graphical objects
• Can run on many CPUs and with many operating
systems
31
Java
Compile once and run on many platforms
32
Objective C
Most popular language for writing Mac OS X applications
33
Programming Languages
37
Mobile Applications
Xcode 4
39
Mobile Applications
Tools for building apps for Android devices
– Android software development kit (SDK) is
required
– Uses well-known IDEs with special plug-ins
Mobile Applications
Corona and Magmito support several
different devices and save time for simple
applications
Natural Language
o Like our natural language (such as Malay, English, French,
or Chinese)
o Its use is still quite limited.
o Tools that allow end users to create or customize computer
programs with natural language.
o For example “make me an app that suggests new careers
paths to me based on people with similar skills and
experiences who have successfully improved their salary and
quality of life with a new career.” (John Spacey, 2016)
42
Examples :
To calculate the salary = rates X hours
• Machine language
• Assembly language
LOAD rate
MULT hour
STOR salary
Language Translator
Program need to translate because computer only understand machine
language
Assembler
Used in assembly language for translate the language to
machine language
Interpreter
Translates one program code statement at a time.
Immediately displays feedback when it finds error.
Compiler
Translating the source code from its original language into
machine code.
Converts the entire source program into machine language at
one time
44
C Language
Is a structured programming language
High level language
Is a case sensitive language
Developed by Dennis Rithcie (1972)
ANSI define a standard on C (1983), which was
followed by ISO (1990)
Designed for writing system software
45
Example of a C Program
46
Program Development
High Level
Language to
Machine Language
(Executable file)
Programmer
Code
Code
Executable Code
49
Exercise
A _____________ translates high-level language
program into ___________.
A(n) _______ provides access to system programs
for editing and compiling.
A C program is saved on disk as a(n) ______ file.
The _______ find syntax error in the _________.
In high-level or assembly language, you can
reference data using ____________ rather than
memory cell address.
_____________ is composed for units such as disk,
flash memory, CDs or DVDs.
53 11/6/20
References
Technology
in Action, 10th Edition, Pearson, Alan Evans,
Kendall Martin and Mary Anne Poatsy. Chapter 10.
C How to Program, Edition, Pearson, Paul Deitel and
Harvey Deitel
C Programming a Q & A Approach, Mc Graw Hill, H.H.
Tan, T.B. D’Orazio, S.H.Or and Marian M.Y.Choy
C Program Design for Engineers, 2nd Edition, Addison
Wesley Jeri R. Hanly and Eliot B. Koffman
54
Self Exercises:
1. What is computer language?
2. Briefly explain what are the different types of computer language?
3. What Is a Computer Language Translator?
4. What is the very first computer programming language in history?
5. How many types of computer language?
6. State the differences between Machine Language and Assembly
Language. Give an example of instructions for each language.
7. What is IDEs?