Week 1 Comp Sci PDF
Week 1 Comp Sci PDF
Foundation Computing II
PUSAT ASASI
UiTM Dengkil
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
Categories of Computers
• Individuals
• Desktop : PC, iMac
• Personal Digital Assistant (PDA)
• Laptop
• Organizations
• Supercomputers
• Mainframes
• Servers
• Minicomputers
4
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
5
Computer Software
Software
6
Computer Hardware
7
Central Processing Unit (CPU)
8
Main Memory (RAM)
• Volatile
9
Coding Schemes
• Each printable and non-printable character is represented by unique
number in memory.
• Encoding – method to encode character to unique number
Compiled Executable
Programmer file (*.exe)
writes program & debug
13
The Importance of Programming
14
The Importance of Programming
Add
features
that
support
personal
needs
Successfully Create
complete miniprograms
projects (macros)
Basic
knowledge of
programming
Create
Add custom
custom commands
applications
15
Type of programming languages
16
Generation of Programming language
• Machine language
• Assembly language
• High Level language
Compiler
machine language program
Computers understand
People understand
binary(11011)
‘program’
Computer
language
evolution
Example:
To calculate wages = rates * hours in machine
language:
100100 010001 //Load
100110 010010 //Multiply
100010 010011 //Store
21
Comparison
23
High-Level Programming Language
25
Some Well-Known High-Level Programming
Languages
26
Visual Basic
27
Visual Basic
28
C and C++
Provides higher-level
programming features
29
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
30
Java
Compile once and run on many platforms
31
Objective C
• Most popular language for writing Mac OS X applications
32
JavaScript and VBScript
Scripting languages
– Allows decisions and calculations
– Adds interactivity to web pages
33
ASP, JSP, and PHP
34
ASP, JSP, and PHP
35
Programming Languages
36
Building Mobile Applications
Special languages and supporting tools help speed development
of applications for mobile devices like smart phones and tablets
37
Mobile Applications
Xcode 4
38
Mobile Applications
• Tools for building apps for Android devices
– Android software development kit (SDK) is
required
– Uses well-known IDEs with special plug-ins
39
Mobile Applications
40
Natural Language
41
Examples :
To calculate the salary = rates X hours
• Machine language
100100 010001 //Load
100110 010010 //Multiply
100010 010011 //Store
• Assembly language
LOAD rate
MULT hour
STOR salary
• Compiler
• Translating the source code from its original language into
machine code.
• Converts the entire source program into machine language at
one time
44
Example of a C Program
45
Program Development
46
High Level Program to Executable Code
1. Programmer create and edit text file containing the
program (source code) with a text editor and save it into
file (source file)
2. Run
1. preprocessor to process the preprocessor directives (begin with #).
2. compiler to:
• Check that the program obeys the rules
• Translate into machine language (object code)
3. linker to connect hardware-specific code to machine instructions, producing an
executable code.
3. Loader : Loads executable file into main memory
4. Execution : Execute the program
47
High Level Language
to Machine Language
(Executable file)
Programmer
Code
Code
Executable Code
48
Flow of Information During Program Execution
49
Integrated Development Environments (IDEs)
50
Code Blocks IDEs
51
References
53