Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

1

Introduction to
Computer
Programming
EIE2264 Computer Programming, PolyU
OBJECTIVES
ƒ Basic hardware and software concepts
ƒ Programming languages

EIE2264 Computer Programming, PolyU 2


1.1 Introduction

• Hardware
– Various devices comprising computer
– Example: keyboard, screen, memory, CD-ROM, etc.
• Software
– Instructions to command computers to perform actions
and make decisions
• Programming language
– A vocabulary and set of grammatical rules for instructing
a computer to perform specific tasks

EIE2264 Computer Programming, PolyU 3


1.1 Introduction
Start
• Structured programming
Do Task A

.
.
.
Do Task N

End

EIE2264 Computer Programming, PolyU 4


1.1 Introduction

• Object-oriented Object A
programming

Program

Object B

Object C

EIE2264 Computer Programming, PolyU 5


1.7 Three Type of Languages

• Computer can only understand 0 and 1.


• The most direct way to communicate with the
computer is to use 0 and 1 ⇒ machine language .
• Machine language
– “Natural language” of computer
– Defined by hardware design
– Example
01000101111
11011110001
10011110010

EIE2264 Computer Programming, PolyU 6


1.7 Three Type of Languages

• Assembly Language
– Is created to help human instructs CPU to work.
– By using a tool called Assembler, assembly language
program can be converted into machine language program.

Assembly Language Machine Language


LD R0, #05 0110001111000010
ADD R0, $1234 0001000111100011
: :
:
Assembler :
SUB R0, #22 0011000100001000
LD $2345, R0 1000001001010101

EIE2264 Computer Programming, PolyU 7


1.7 Three Type of Languages

• Assembly language programming is still too


complicated for general users.
• A high level language is required to close the gap
between human and computers.

EIE2264 Computer Programming, PolyU 8


1.7 Three Type of Languages

– High-level languages
– Similar to everyday English
– Single statements accomplish substantial tasks.
– Convert to machine language by translator programs
(compilers).

EIE2264 Computer Programming, PolyU 9


1.7 Three Type of Languages
Executable
Machine Language Program
1011010101
Linker 0101010101
:
Library
Object code

Give me
the result
of adding
Compiler
1 to 10
High Level Program
EIE2264 Computer Programming, PolyU 10
Class Work

• The level of a computer language most convenient


for you to write programs quickly and easily is

______________________ .

• The only language that a computer directly


understands is called that computer’s

______________________ .

EIE2264 Computer Programming, PolyU 11


1.8 History of C and C++

• History of C
– Evolved from BCPL and B
– Developed by Bell Laboratories
– Development language of UNIX
– Hardware independent

EIE2264 Computer Programming, PolyU 12


1.8 History of C and C++

• History of C++
– Extension of C
– Also developed by Bell Laboratories
– Provides new features to “upgrade” C
– Provides capabilities for object-oriented programming

EIE2264 Computer Programming, PolyU 13


1.10 History of Java

• Java
– Designed by Sun Microsystems
– Used for:
• Creating Web pages with dynamic content
• Developing large-scale enterprise applications
• Enhancing World Wide Web server functionality
• Providing applications for consumer devices (cell phones, etc.)

EIE2264 Computer Programming, PolyU 14


1.11 Other Programming Languages

• FORTRAN
– FORmula TRANslator
– Used in engineering applications
• COBOL
– COmmon Business Oriented Language
– Used in business software

EIE2264 Computer Programming, PolyU 15


1.11 Other Programming Languages

• Pascal
– Designed to teach structured programming
• Ada
– Capable of multitasking

EIE2264 Computer Programming, PolyU 16


1.12 Other Programming Languages

• BASIC
– Beginner’s All-Purpose Symbolic Instruction Code
– Familiarize novices with programming techniques
• .NET platform
– Provides developers with capabilities

EIE2264 Computer Programming, PolyU 17


1.12 Other Programming Languages

• Visual Basic .NET


– Based on BASIC
• Visual C++
– Based on C++
• C#
– Based on C++ and Java

EIE2264 Computer Programming, PolyU 18


1.17 UML

• Unified Modeling Language (UML)


– Graphical language that uses common notation
– Allows developers to represent object-oriented designs

EIE2264 Computer Programming, PolyU 19


Until Next Time

• Review Chapter 1
• Preview Chapter 2

EIE2264 Computer Programming, PolyU 20

You might also like