20
Introduction to Programming Tutor: Bilal Janjooa Assistant Professor The University of Lahore MS Telecom. Eng. From The University of Sunderland UK 1 Bilal Janjooa [email protected]

Programming fundamentals ch 1

Embed Size (px)

Citation preview

Page 1: Programming fundamentals ch 1

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]

Page 2: Programming fundamentals ch 1

Bilal Janjooa [email protected] 2

Introduction to Programming

Lecture No. 1

Page 3: Programming fundamentals ch 1

Bilal Janjooa [email protected] 3

AssessmentsQuiz & Assignments 25% 25 MarksMid Exam 25% 25 MarksFinal Exam 50% 50 Marks

Page 4: Programming fundamentals ch 1

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

Page 5: Programming fundamentals ch 1

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

Page 6: Programming fundamentals ch 1

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

Page 7: Programming fundamentals ch 1

Bilal Janjooa [email protected] 7

Program“An accurate sequence of steps to

solve a particular problem”

Page 8: Programming fundamentals ch 1

Bilal Janjooa [email protected] 8

Critical Skills Analysis Critical Thinking Attention to Detail

Page 9: Programming fundamentals ch 1

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

Page 10: Programming fundamentals ch 1

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

Page 11: Programming fundamentals ch 1

Bilal Janjooa [email protected] 11

Computers are

STUPID

Page 12: Programming fundamentals ch 1

Bilal Janjooa [email protected] 12

Humans are even more…….

Page 13: Programming fundamentals ch 1

Bilal Janjooa [email protected] 13

Think Reuse

Page 14: Programming fundamentals ch 1

Bilal Janjooa [email protected] 14

Area of the RingInner CircleOuter Circle

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

Page 15: Programming fundamentals ch 1

Bilal Janjooa [email protected] 15

Think Reuse Think User Interface

Comments liberally

Page 16: Programming fundamentals ch 1

Bilal Janjooa [email protected] 16

Logical ErrorLewis Carol: “Through the Looking Glass”

“Twas brillig, and the slithy tovesDid gyre and gimble in the wabe “

Page 17: Programming fundamentals ch 1

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

Page 18: Programming fundamentals ch 1

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

Page 19: Programming fundamentals ch 1

Bilal Janjooa [email protected] 19

Books Deitel & Deitel :– C++ How to Program Kernighan and Ritchie:- The C Programming Language

Page 20: Programming fundamentals ch 1

Bilal Janjooa [email protected] 20

Thank You