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

26
Introduction to Introduction to Programming Programming Lecture No. 1 Lecture No. 1

Upload: roxanne-jennings

Post on 04-Jan-2016

226 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

Introduction to Introduction to ProgrammingProgramming

Lecture No. 1Lecture No. 1

Page 2: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

ProgramProgram

““A precise A precise sequence of sequence of

steps tosteps tosolve a solve a

particular particular problem”problem”

Page 3: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular 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? “

Page 4: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

Critical SkillsCritical Skills– AnalysisAnalysis– Critical Critical ThinkingThinking

– Attention Attention to Detailto Detail

Page 5: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 6: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

– 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

Page 7: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

Computers are Computers are

STUPIDSTUPID

Page 8: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 9: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

Think Think ReuseReuse

Page 10: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

Area of the Area of the RingRing

Outer Circle

Inner Circle

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

Page 11: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

Think ReuseThink Reuse Think User Think User InterfaceInterface

Comments liberally Comments liberally

Page 12: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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.

Page 13: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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 “

Page 14: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 15: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 16: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 17: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 18: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 19: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

programmingprogramming SocketsSockets

Page 20: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 21: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 22: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 23: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 24: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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

Page 25: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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: [email protected]@niit.edu.pk Exceptional meeting:Exceptional meeting:

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

Page 26: Introduction to Programming Lecture No. 1. Program “A precise sequence of steps to solve a particular problem”

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.