Upload
adeem-mirza
View
115
Download
0
Embed Size (px)
Citation preview
1
Introduction to Programming
Tutor: Bilal Janjooa Assistant Professor The University of Lahore
MS Telecom. Eng. From The University of Sunderland UK
Bilal Janjooa [email protected]
Bilal Janjooa [email protected] 3
AssessmentsQuiz & Assignments 25% 25 MarksMid Exam 25% 25 MarksFinal Exam 50% 50 Marks
Bilal Janjooa [email protected] 4
Course ObjectivesObjectives 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
Bilal Janjooa [email protected] 5
What Is a Computer?Computer
Performs computations and makes logical decisions
Millions / billions times faster than human beings
Computer programsSets of instructions by which a computer
processes dataHardware
Physical devices of computer systemSoftware
Programs that run on computers
Bilal Janjooa [email protected] 6
Computer OrganizationSix 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 [email protected] 7
Program“An accurate sequence of steps to
solve a particular problem”
Bilal Janjooa [email protected] 9
Design RecipeTo design a program properly, we must:
Analyze a problem statement, typically expressed as a word problemFormulate statements and comments in a specific languageEvaluate and revise the activities in light
of checks and tests
Bilal Janjooa [email protected] 10
PAY ATTENTION TO DETAIL These skills are useful for anybody All assignments in this course should follow the these guidelines
Bilal Janjooa [email protected] 14
Area of the RingInner CircleOuter Circle
Area of Inner Circle____Area of Outer Circle = Area of the Ring
Bilal Janjooa [email protected] 16
Logical ErrorLewis Carol: “Through the Looking Glass”
“Twas brillig, and the slithy tovesDid gyre and gimble in the wabe “
Bilal Janjooa [email protected] 17
Machine Languages, Assembly Languages, and High-level Languages Three types of programming
languagesMachine 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 BASEPAYADD OVERPAYSTORE GROSSPAY
17
Bilal Janjooa [email protected] 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
Bilal Janjooa [email protected] 19
Books Deitel & Deitel :– C++ How to Program Kernighan and Ritchie:- The C Programming Language