introduction to programming lecture no. 1. program “a precise sequence of steps to solve a...

Post on 04-Jan-2016

226 Views

Category:

Documents

5 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Introduction to Introduction to ProgrammingProgramming

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 Perlis – Yale University:Alan Perlis – 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? “

Critical SkillsCritical Skills– AnalysisAnalysis– Critical Critical ThinkingThinking

– Attention Attention to Detailto Detail

Design RecipeDesign RecipeTo design a program properly, we must:To design a program properly, we 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 activities in light ofEvaluate and revise the activities in light of

checks and testschecks and tests

– PAY ATTENTION TO DETAILPAY ATTENTION TO DETAIL– These skills are useful forThese skills are useful for

anybodyanybody– All assignments in this All assignments in this

coursecourse

should follow the theseshould follow the these

guidelinesguidelines

Computers are Computers are

STUPIDSTUPID

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

Think Think ReuseReuse

Area of the Area of the RingRing

Outer Circle

Inner Circle

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

Think ReuseThink Reuse Think User Think User InterfaceInterface

Comments liberally Comments liberally

What is the probability that she What is the probability that she getsgets

exactly three letter right i.e. threeexactly three letter right i.e. three

Letters into their correct Letters into their correct envelopes.envelopes.

Logical ErrorLogical Error

Lewis Carol: “Through the Looking Lewis Carol: “Through the Looking Glass”Glass”

““Twas brillig, and the slithy tovesTwas brillig, and the slithy toves

Did gyre and gimble in the wabe “Did gyre and gimble in the wabe “

Course PolicyCourse PolicyQuizzes : 10 % One Hour Tests : 30 %Lab : 5%Assignments : 5%Project : 5 %Final Test : 45%

BooksBooks Deitel & Deitel :– C++ How to Deitel & Deitel :– C++ How to

ProgramProgram Kernighan and Ritchie:-Kernighan and Ritchie:-

The C Programming The C Programming LanguageLanguage

Course ObjectivesCourse Objectives

Objectives of this course are three Objectives of this course are three foldfold

1.1. To appreciate the need for a To appreciate the need for a programming languageprogramming language

2.2. To introduce the concept and To introduce the concept and usability of the structured usability of the structured programming methodologyprogramming methodology

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

Course ContentsCourse ContentsTo achieve our first two objectives weTo achieve our first two objectives we

will 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 functions Control structures and 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 SocketsSockets

BooksBooks

Text BooksText Books

– How to Program – C by H.M. Dietel / How to Program – C by H.M. Dietel / P.J. Deitel P.J. Deitel

– The C Programming Language by The C Programming Language by Brian W. Kernighan, Dennis M. Brian W. Kernighan, Dennis M. RitchieRitchie

BooksBooks

Reference BooksReference Books (very important part)(very important part)

– Learning C by Neill GrahamLearning C by Neill Graham– C++, How to Program by Deitel & C++, How to Program by Deitel &

DeitelDeitel– Thinking in C++ by Bruce EckelThinking in C++ by Bruce Eckel– www.cprogramming.comwww.cprogramming.com– www.cplusplus.comwww.cplusplus.com– www.howstuffworks.comwww.howstuffworks.com– www.whatis.comwww.whatis.com

PoliciesPolicies Bring your own calculator, pen paper etc..Bring your own calculator, pen paper etc.. You will not be allowed to borrow anything You will not be allowed to borrow anything

from anyone during any testfrom anyone during any test Must write your name and reference Must write your name and reference

number (Merit No or Regn No) in a testnumber (Merit No or Regn No) in a test No late work will be acceptedNo late work will be accepted (unless (unless

arrangements have been made in advance)arrangements have been made in advance) Ask questions; participate actively in classAsk questions; participate actively in class You are allowed to talk to instructor onlyYou are allowed to talk to instructor only

PoliciesPolicies You are responsible for what is You are responsible for what is

covered in class – even if you don’t covered in class – even if you don’t show upshow up

Deficiency in attendance may lead to Deficiency in attendance may lead to termination or relegation termination or relegation

You are encouraged to help each other You are encouraged to help each other with your homework assignments – but with your homework assignments – but you must turn in your own workyou must turn in your own work

If you are found to be cheating, you If you are found to be cheating, you will fail at least the assignment / test will fail at least the assignment / test and perhaps the entire classand perhaps the entire class

PoliciesPolicies

If you have any learning If you have any learning disabilities or special needs, disabilities or special needs, please let me know please let me know in advance in advance through email or personal through email or personal meetingmeeting

Check your email regularly for Check your email regularly for messagesmessages

Quizzes are Quizzes are unannouncedunannounced

ContactsContacts

Office: Office: Academic Block -IIAcademic Block -II

Phone 051-9280439 Ext 129Phone 051-9280439 Ext 129 Office Hours: Office Hours: Monday 1000 – 1200 hrsMonday 1000 – 1200 hrs email:email: dr.raihan@niit.edu.pkdr.raihan@niit.edu.pk Exceptional meeting:Exceptional meeting:

Give me an email and get time.Give me an email and get time.

Course Web PageCourse Web Page

http://www.niit.edu.pk/http://www.niit.edu.pk/~~dr.raihandr.raihan//

BICSE_5_courses.htmlBICSE_5_courses.html

For CR: Please make a Yahoo/msn For CR: Please make a Yahoo/msn or Google group!or Google group!

Collect and send me the email Collect and send me the email addresses of all students.addresses of all students.

top related