1. Tutor: Bilal Janjooa Assistant Professor
The University of Lahore
MS Telecom. Eng. From The University of Sunderland UK
1Bilal Janjooa bilal.janjooa@yahoo.co.uk
3. Assessments
Quiz & Assignments 25% 25 Marks
Mid Exam 25% 25 Marks
Final Exam 50% 50 Marks
3Bilal Janjooa bilal.janjooa@yahoo.co.uk
4. Course Objectives
Objectives of this course are:
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
4Bilal Janjooa bilal.janjooa@yahoo.co.uk
5. 5
What Is a Computer?
Computer
Performs computations and makes logical decisions
Millions / billions times faster than human beings
Computer programs
Sets of instructions by which a computer processes data
Hardware
Physical devices of computer system
Software
Programs that run on computers
Bilal Janjooa bilal.janjooa@yahoo.co.uk
6. 6
Computer Organization
Six logical units of computer system
Input unit
Mouse, keyboard
Output unit
Printer, monitor, audio speakers
Memory unit
Retains input and processed information
Arithmetic and logic unit (ALU)
Performs calculations
Central processing unit (CPU)
Supervises operation of other devices
Secondary storage unit
Hard drives, floppy drives
Bilal Janjooa bilal.janjooa@yahoo.co.uk
9. Design Recipe
To design a program properly, we must:
Analyze a problem statement, typically
expressed as a word problem
Formulate statements and comments in a
specific language
Evaluate and revise the activities in light of
checks and tests
9Bilal Janjooa bilal.janjooa@yahoo.co.uk
10. PAY ATTENTION TO DETAIL
These skills are useful for
anybody
All assignments in this course
should follow the these
guidelines
10Bilal Janjooa bilal.janjooa@yahoo.co.uk
14. Area of the Ring
Inner
Circle
Outer
Circle
Area of Inner Circle____Area of Outer Circle = Area of the Ring
14Bilal Janjooa bilal.janjooa@yahoo.co.uk
16. Logical Error
Lewis Carol: “Through the Looking Glass”
“Twas brillig, and the slithy toves
Did gyre and gimble in the wabe “
16Bilal Janjooa bilal.janjooa@yahoo.co.uk
17. Machine Languages, Assembly Languages,
and High-level Languages
Three types of programming languages
Machine languages
Strings of numbers giving machine specific instructions
Example:
+1300042774 (these would really be in binary)
+1400593419
+1200274027
Assembly languages
English-like abbreviations representing elementary
computer operations (translated via assemblers)
Example:
LOAD BASEPAY
ADD OVERPAY
STORE GROSSPAY
17
17Bilal Janjooa bilal.janjooa@yahoo.co.uk
18. Machine Languages, Assembly Languages,
and High-level Languages
High-level languages
Instructions closer to everyday English
English is a natural language. Although high level
programming languages are closer to natural languages.
Use mathematical notations (translated via compilers)
Example:
grossPay = basePay + overTimePay
18
18Bilal Janjooa bilal.janjooa@yahoo.co.uk
19. Books
Deitel & Deitel :– C++ How to Program
Kernighan and Ritchie:-
The C Programming Language
19Bilal Janjooa bilal.janjooa@yahoo.co.uk