CS201- Introduction to Programming- Lecture 01

Post on 10-Jul-2015

40 views 1 download

Tags:

transcript

Introduction to ProgrammingIntroduction to Programming

Lecture No. 1Lecture No. 1

ProgramProgram

““A precise A precise sequence of sequence of

steps tosteps tosolve a solve a particular particular problem”problem”

Alan Perl is – Yale University:Alan Perl is – Yale University:

““It goes against the grain of modernIt goes against the grain of modern education to teach children to program.education to teach children to program. What fun is there in making plans,What fun is there in making plans, acquiring discipline in organizingacquiring discipline in organizing thoughts, devoting attention to detailthoughts, devoting attention to detail and learning to be self-critical? “and learning to be self-critical? “

Crit ical Skil lsCrit ical Skil ls– AnalysisAnalysis– Critical Critical

ThinkingThinking– Attention Attention

to Detailto Detail

Design RecipeDesign RecipeTo design a program properly, we To design a program properly, we

must:must:– Analyze a problem statement, typicallyAnalyze a problem statement, typically expressed as a word problemexpressed as a word problem– Express its essence, abstractly and withExpress its essence, abstractly and with examplesexamples– Formulate statements and comments in aFormulate statements and comments in a precise languageprecise language– Evaluate and revise the activit ies in l ight Evaluate and revise the activit ies in l ight

ofof checks and testschecks and tests

– PAY ATTENTION TO DETAILPAY ATTENTION TO DETAIL– These skil ls are useful forThese skil ls are useful for anybodyanybody– All assignments in this courseAll assignments in this course should follow the theseshould follow the these guidelinesguidelines

Computers are Computers are

STUPIDSTUPID

HumansHumans are are even more…….even more…….

Think ReuseThink Reuse

Area of the RingArea of the Ring

Outer Circle

Inner Circle

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

Think ReuseThink Reuse Think User InterfaceThink User Interface Comments l iberally Comments l iberally

What is the probability that she getsWhat is the probability that she gets exactly three letter right i.e. threeexactly three letter right i.e. three Letters into their correct envelopes.Letters into their correct envelopes.

Logical ErrorLogical ErrorLewis Carol: “Through the Looking Glass”Lewis Carol: “Through the Looking Glass”

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

Course PolicyCourse PolicyPolicy for the distribution of marks andPolicy for the distribution of marks andexamination is as followsexamination is as follows Assignments 15%Assignments 15% Group discussion 5%Group discussion 5% Midterm 35 %Midterm 35 % Final 45 %Final 45 %

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

Course ObjectivesCourse Objectives

Objectives of this course are three foldObjectives of this course are three fold1.1. To appreciate the need for a To appreciate the need for a

programming languageprogramming language2.2. To introduce the concept and usability To introduce the concept and usability

of the structured programming of the structured programming methodologymethodology

3.3. To develop proficiency in making useful To develop proficiency in making useful software using the C language software using the C language

Course ContentsCourse ContentsTo achieve our first two objectives weTo achieve our first two objectives wewill be discussingwill be discussing Basic Programming constructs andBasic Programming constructs and building blocksbuilding blocks Structured programmingStructured programming Structured flowcharts, pseudo-codeStructured flowcharts, pseudo-code

Course ContentsCourse Contents History of C LanguageHistory of C Language Variables and expressions in CVariables and expressions in C Control structures and Control structures and

functions functions Arrays and PointersArrays and Pointers Dynamic memory AllocationDynamic memory Allocation

Course ContentsCourse Contents File handling File handling Structures and UnionsStructures and Unions Flavor of Object oriented Flavor of Object oriented

programmingprogramming