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
Lecture No. 1
2Bilal Janjooa bilal.janjooa@yahoo.co.uk
Assessments
Quiz & Assignments 25% 25 Marks
Mid Exam 25% 25 Marks
Final Exam 50% 50 Marks
3Bilal Janjooa bilal.janjooa@yahoo.co.uk
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
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
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
Program
“An accurate sequence of steps to
solve a particular problem”
7Bilal Janjooa bilal.janjooa@yahoo.co.uk
Critical Skills
 Analysis
 Critical Thinking
 Attention to Detail
8Bilal Janjooa bilal.janjooa@yahoo.co.uk
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
 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
Computers are
STUPID
11Bilal Janjooa bilal.janjooa@yahoo.co.uk
Humans are
even more…….
12Bilal Janjooa bilal.janjooa@yahoo.co.uk
Think Reuse
13Bilal Janjooa bilal.janjooa@yahoo.co.uk
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
 Think Reuse
 Think User Interface
 Comments liberally
15Bilal Janjooa bilal.janjooa@yahoo.co.uk
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
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
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
Books
 Deitel & Deitel :– C++ How to Program
 Kernighan and Ritchie:-
The C Programming Language
19Bilal Janjooa bilal.janjooa@yahoo.co.uk
Thank You
20Bilal Janjooa bilal.janjooa@yahoo.co.uk

Programming fundamentals ch 1

  • 1.
    Tutor: Bilal JanjooaAssistant Professor The University of Lahore MS Telecom. Eng. From The University of Sunderland UK 1Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 2.
    Lecture No. 1 2BilalJanjooa bilal.janjooa@yahoo.co.uk
  • 3.
    Assessments Quiz & Assignments25% 25 Marks Mid Exam 25% 25 Marks Final Exam 50% 50 Marks 3Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 4.
    Course Objectives Objectives ofthis 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 aComputer?  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  Sixlogical 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
  • 7.
    Program “An accurate sequenceof steps to solve a particular problem” 7Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 8.
    Critical Skills  Analysis Critical Thinking  Attention to Detail 8Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 9.
    Design Recipe To designa 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 ATTENTIONTO DETAIL  These skills are useful for anybody  All assignments in this course should follow the these guidelines 10Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 11.
    Computers are STUPID 11Bilal Janjooabilal.janjooa@yahoo.co.uk
  • 12.
    Humans are even more……. 12BilalJanjooa bilal.janjooa@yahoo.co.uk
  • 13.
    Think Reuse 13Bilal Janjooabilal.janjooa@yahoo.co.uk
  • 14.
    Area of theRing Inner Circle Outer Circle Area of Inner Circle____Area of Outer Circle = Area of the Ring 14Bilal Janjooa bilal.janjooa@yahoo.co.uk
  • 15.
     Think Reuse Think User Interface  Comments liberally 15Bilal 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, AssemblyLanguages, 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, AssemblyLanguages, 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
  • 20.
    Thank You 20Bilal Janjooabilal.janjooa@yahoo.co.uk