You are on page 1of 24

Introduction to Programming

Introduction Lab
saqib.rasheed@mail.au.edu.pk

Air University 1
“Introduction to
Computer Science and
Programming in C++”

2
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?”


3
What is a computer?

 A device that executes a sequence of


computations and instructions.
 Modern computers are electronic and digital.

4
Program
“A precise sequence
of steps to
solve a particular
problem”

5
Critical Skills
 Analysis
 Critical Thinking
 Attention to Detail

6
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

7
 PAY ATTENTION TO DETAIL
 These skills are useful for

anybody
 All assignments in this course

should follow the these


guidelines

8
Computers are

STUPID
9
Humans are even
more…….

10
Think Reuse

11
Area of the Ring
Inner Circle

Outer Circle

Area of Outer Circle ____ Area of Inner Circle = Area of the Ring

12
 Think Reuse
 Think User Interface
 Comments liberally

13
Books
 Ivor Horton’s
 Deitel & Deitel :– C++ How to Program

14
Course Objectives

Objectives of this course are three fold


1. To appreciate the need for a programming
language
2. To introduce the concept and usability of
the structured programming methodology
3. To develop proficiency in making useful
software using the C language

15
Course Contents
To achieve our first two objectives we
will be discussing
 Basic Programming constructs and

building blocks
 Structured programming

 Structured flowcharts, pseudo-code

16
Course Contents
 History of C Language
 Variables and expressions in C

 Control structures and functions

 Arrays and Pointers

 Dynamic memory Allocation

17
Course Contents
 File handling
 Structures and Unions
 Flavor of Object oriented programming

18
 Software Categories
 System Software

 Application Software

 Introduction to ‘C’ Language


 History

 Evolution

 Justification

 Development Environment of ‘C’


19
There are two main categories of software

 System software

 Application Software

20
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 the
program. A C++ compiler compiles C++ programs into
Machine language

21
Tools of the trade

 Editor
 Interpreter and Compilers
 Debuggers

22
Integrated Development Environment
(IDE)

It contains
 Editor
 Compilers
 Debugger
 Linkers
 Loaders

23
Program is created in the
Editor Disk editor and stored on disk.
Preprocessor program
Preprocessor Disk processes the code.
Compiler creates
Compiler Disk object code and stores
it on disk.
Linker Disk Linker links the object
code with the libraries
Primary Memory
Loader
Loader puts program
in memory.
Disk ..
..
..

Primary Memory
CPU takes each
CPU instruction and
 
executes it, possibly
storing new data
..
..
values as the program
..
executes.

24

You might also like