intro ducat ion
TRANSCRIPT
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 1/24
1 Air University
Introduction to Programming
Introduction [email protected]
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 2/24
2
³Introduction to
Computer Science and
Programming in C++´
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 3/24
3
What is Computer
Science?
Scientific study of computers.
³What can and can¶t computers do?´ ³If a computer can do something,
how can we do it efficiently?´
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 4/24
4
What is a computer?
A device that executes a sequence of
computations and instructions. Modern computers are electronic and digital.
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 5/24
5
Program
³A precise sequenceof steps to
solve a particular problem´
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 6/24
6
Critical Skills
Analysis
Critical Thinking Attention to Detail
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 7/24
7
Design Recipe
To design a program properly, we must:
Analyze a problem statement, typically
expressed as a word problem
Express its essence, abstractly and with
examples
Formulate statements and comments in a
precise language
Evaluate and revise the activities in light of
checks and tests
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 8/24
8
PAY ATTENTION TO DETAIL
These skills are useful for
anybody All assignments in this course
should follow the these
guidelines
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 9/24
9
Computers are
STUPID
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 10/24
10
Humans are
even more««.
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 11/24
11
Think Reuse
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 12/24
12
Area of the Ring
Outer Circle
Inner Circle
Area of Inner Circle ____ Area of Outer Circle = Area of the Ring
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 13/24
13
T
hink Reuse Think User Interface
Comments liberally
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 14/24
14
Books Ivor Horton¶s
Deitel & Deitel :± C++ How to Program
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 15/24
15
Course Objectives
Objectives of this course are three fold
1. To appreciate the need for a programminglanguage
2. To introduce the concept and usability of
the structured programming methodology
3. To develop proficiency in making usefulsoftware using the C language
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 16/24
16
Course ContentsTo achieve our first two objectives we
will be discussing Basic Programming constructs and
building blocks
Structured programming Structured flowcharts, pseudo-code
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 17/24
17
Course Contents
History of C Language
Variables and expressions in C Control structures and functions
Arrays and Pointers
Dynamic memory Allocation
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 18/24
18
Course Contents File handling
Structures and Unions
Flavor of Object oriented programming
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 19/24
19
Software Categories
System Software Application Software
Introduction to µC¶ Language
History
Evolution
Justification
Development Environment of µC¶
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 20/24
20
There are two main categories of software
System software
Application Software
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 21/24
21
GETTING STARTED
To write and run C++ programs, you need to have a
text editor and a C++ compiler installed on your computer. A text editor is a software system that
allows you to create and edit text files on your
computer. Programmers use text editors to write
programs in a programming language such as C++. A compiler is a software system that translates
programs into the machine language (called binary
code) that the computer¶s operating system can then
run. That translation process is called compiling theprogram. A C++ compiler compiles C++ programs into
Machine language
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 22/24
22
Tools of t
he trade
Editor
Interpreter and Compilers
Debuggers
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 23/24
23
Integrated Development Environment
(IDE)
It contains
Editor
Compilers
Debugger
Linkers Loaders
8/8/2019 Intro Ducat Ion
http://slidepdf.com/reader/full/intro-ducat-ion 24/24
24
Preprocessor program processes the code.
Loader puts program
in memory.
CPU takes eachinstruction and
executes it, possibly
storing new data
values as the program
executes.
Compiler creates
object code and stores
it on disk.
Linker links the object
code with the libraries
Loader
Primary Memory
Compiler
Editor
Preprocessor
Linker
Primary Memory
.
.
.
.
.
.
.
.
.
.
.
.
Disk
Disk
Disk
CPU
Disk
Disk Program is created in the
editor and stored on disk.