0% found this document useful (0 votes)
12 views

Lecture-1-Introduction Intro Programming

Uploaded by

adrhydros
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Lecture-1-Introduction Intro Programming

Uploaded by

adrhydros
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

IT102: PROGRAMMING

1 AND LOGIC
FORMULATION
Introduction: Computers and Programming Languages
Lecture 1
Computers and Programming
• A computer is just a machine (the hardware) for executing programs
(the software)
• Hence, the software rules the hardware!

• The process of creating software is called programming, and it is the


focus of this course

• Virtually, anyone can learn how to program computers


Why Learn Programming?
• Computers have become commonplace in our modern life
• Understanding the strengths and limitations of computers requires some
understanding of programming

• Programming can be loads of fun! Ubiquitous


Astronomy
• It is an intellectually engaging activity that allows you to express yourself
Computing

through remarkably beautiful creations


Smaller, Faster,
Cheaper Sensors

• Programming develops Gene


valuable problem-solving skills, especially
ones that pertainSequencing
to analysis,
and
Biotechnology
design and implementation
Why Learn Programming?
• Computers have become commonplace in our modern life
• Applying ideas in different fields requires programming

• Programming can be loads of fun!


• It is an intellectually engaging activity that allows you to express yourself
through remarkably beautiful constructs and structures

• Programming develops valuable problem-solving skills, especially


ones that certain to analysis, design and implementation

• Programmers are in great demand!


Programming Languages
• A program is just a sequence of instructions telling the computer
what to do

• Obviously, we need to provide these instructions in a language that


computers can understand
• We refer to this kind of a language as a programming language
• Python, Java, C and C++ are examples of programming languages

• Every structure in a programming language has an exact form (i.e.,


syntax) and a precise meaning (i.e., semantic)
Computer Programming
An algorithm is a step-by-step process.

A computer program is a step-by-


step set of instructions for a computer.

Every computer program is an algorithm.


Computer Programming

The history of computer programming is a


steady move away from machine-oriented
views of programming towards concepts and
metaphors that more closely reflect the way
in which we ourselves see & understand the
world
Programming Languages
• Programming languages allow programmers
to develop software.
• The three major families of languages are:
– Machine languages
– Assembly languages
– High-Level languages
Machine Languages
• Comprised of 1s and 0s
• The “native” language of a computer
• Difficult to program – one misplaced 1 or 0
will cause the program to fail.
• Example of code:
1110100010101 111010101110
10111010110100 10100011110111
Assembly Languages
• Assembly languages are a step towards easier
programming.
• Assembly languages are comprised of a set of
elemental commands which are tied to a
specific processor.
• Assembly language code needs to be translated
to machine language before the computer
processes it.
• Example:
ADD 1001010, 1011010
High-Level Languages
• High-level languages represent a giant leap
towards easier programming.
• The syntax of HL languages is similar to English.
• Example:
grossPay = basePay + overTimePay
• Interpreter – Executes high level language programs without
compilation.

• Historically, we divide HL languages into two


groups:
– Procedural languages
– Object-Oriented languages (OOP)
Procedural Languages
• Early high-level languages are typically called
procedural languages.
• Procedural languages are characterized by
sequential sets of linear commands. The focus
of such languages is on structure.
• Examples include C, COBOL, Fortran, LISP,
Perl, HTML, VBScript
Object-Oriented Languages
• The focus of OOP languages is not on structure,
but on modeling data.
• Programmers code using “blueprints” of
data models called classes.
• Examples of OOP languages include
C++, Visual Basic.NET and Java.
Early programming languages
1950s 1960s 1970s
Simula
Lisp
Algol60 Algol68

Fortran Pascal

COBOL BCPL Classic C

PL\1

Red==major commercial use


12
Blue==will produce important “offspring”
Modern programming languages
Lisp Python
Smalltalk PHP
Fortran77
Eiffel Java95 Java04
Simula67

C89 C++ C++98 C++0x

Ada Ada98 C#

Pascal Object Pascal


COBOL04 Javascript
COBOL89
Visual Basic
PERL 13
Machine Languages
• Python, Java, C, and C++ are, indeed, examples of high-level languages

• Strictly speaking, computer hardware can only understand a very low-


level language known as machine language

• If you want a computer to add two numbers, the instructions that the
CPU will carry out might be something like this:
Load the number from memory location 2001 into the CPU
Load the number from memory location 2002 into the CPU A Lot of
Add the two numbers in the CPU Work!
Store the result into location 2003
High-Level to Low-Level Languages
• In a high-level language like Python, the addition of two numbers can
be expressed more naturally:
c=a+b Much Easier!

• But, we need a way to translate the high-level language into a


machine language that a computer can execute
• To this end, high-level language can either be compiled or interpreted

You might also like