SlideShare a Scribd company logo
1 of 21
A First Book of C++
Chapter 1(Pt 2)
Programming Design
&
Paradigm
A First Book of C++
Programming Design
 Step 1 - Analyze the problem
 Outline the problem and its requirements
 Design steps (algorithm) to solve the problem
 Step 2 - Implement the algorithm
 Implement the algorithm in code
 Verify that the algorithm works
 Step 3 - Maintenance
 Use and modify the program if the problem domain
changes
Problem Solving Process
(revisit)
C++ Programming: From Problem Analysis to Program
Design, Third Edition
3
 Thoroughly understand the problem
 Understand problem requirements
 Does program require user interaction?
 Does program manipulate data?
 What is the output?
 If the problem is complex, divide it into sub-
problems
 Analyze each sub-problem as above
Analyze the Problem
C++ Programming: From Problem Analysis to Program
Design, Third Edition
5
 If problem was broken into sub-problems
 Design algorithms for each sub-problem
 Check the correctness of algorithm
 Can test using sample data
 Some mathematical analysis might be required
Design an Algorithm
C++ Programming: From Problem Analysis to Program
Design, Third Edition
6
 Once the algorithm is designed and correctness
verified
 Write the equivalent code in high-level language
 Type the program using text editor
Write the Code
C++ Programming: From Problem Analysis to Program
Design, Third Edition
7
 Run code through compiler
 If compiler generates errors
 Look at code and remove errors
 Run code again through compiler
 If there are no syntax errors
 Compiler generates equivalent machine code
 Linker links machine code with system resources
Compiling and Linking
C++ Programming: From Problem Analysis to Program
Design, Third Edition
8
 Once compiled and linked, loader can place
program into main memory for execution
 The final step is to execute the program
 Compiler guarantees that the program follows the
rules of the language
 Does not guarantee that the program will run
correctly
The Loader and Executing
C++ Programming: From Problem Analysis to Program
Design, Third Edition
9
A First Book of C++
Programming Paradigm
Definition:
A way of conceptualizing what it means to
perform computation and how tasks to be carried
out on the computer should be structured and
organized.
Programming Paradigm
A First Book of C++ 4th Edition 11
 General types of programming paradigms:
 Structural
 Imperative
 Declarative
 Procedural
 Object-Oriented
 Functional
 Domain-Specific
Programming Paradigm
(cont'd.)
A First Book of C++ 4th Edition 12
 Structured programming (or modular
programming) is a problem solving strategy
and a programming methodology that
includes the following guidelines:
 The flow of control in the program should be as
simple as possible.
 The construction of a program should embody
top-down design.
Programming Paradigm
(cont'd.)
A First Book of C++ 4th Edition 13
 Top-down design means:
 It repeatedly decomposing a problem into
smaller problems.
 Eventually leads to:
 a collection of small problems or tasks.
 each can be easily coded
Programming Paradigm
(cont'd.)
A First Book of C++ 4th Edition 14
 Object-oriented programming is a method of
programming based on a hierarchy of classes, and
well-defined and cooperating objects.
 A class is a structure that defines the data and the
methods to work on that data.
 In simple definition, a class is a programmer defined
data type.
Programming Paradigm
(cont'd.)
A First Book of C++ 4th Edition 15
 Object-oriented programming (OOP) concepts are:
Programming Paradigm
(cont'd.)
A First Book of C++ 4th Edition 16
Concepts Functions
Data Abstraction specifies behavior
Encapsulation controls visibility of names (data
hiding)
Polymorphism accommodates various
implementations
Inheritance facilitates code reuse
Modularity relates to unit of compilation
Structured vs. Object-Oriented
Programming
A First Book of C++ 4th Edition 17
Structured Programming:
MAIN PROGRAM
FUNCTION 3FUNCTION 2
GLOBAL DATA
FUNCTION 5FUNCTION 4
FUNCTION
1
Structured Programming:
 Using functions.
 Function & program is divided into modules.
 Every module has its own data and function which
can be called by other modules.
Structured vs. Object-Oriented
Programming
A First Book of C++ 4th Edition 18
Structured vs. Object-Oriented
Programming (cont'd.)
A First Book of C++ 4th Edition 19
Object-Oriented Programming:
Object 1
Object 2
Data
Function
Data
Function
Object 3
Data
Function
Object-Oriented Programming:
 Objects have both data and methods.
 Objects of the same class have the same data
elements and methods.
 Objects send and receive messages to invoke
actions.
Structured vs. Object-Oriented
Programming
A First Book of C++ 4th Edition 20
 Data object
 Set of values packaged as single unit (e.g., student’s
name & grade)
 Class
 Set of objects with similar attributes
 General concept of object-oriented programming is the
difference between an object and the larger set of which
it is a member (class)
 A red Ford is an instance, or object, of a general class
of automobiles or cars
Classes and Objects
A First Book of C++ 4th Edition 21

More Related Content

What's hot

Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programingAhammed Alamin
 
9781285852744 ppt ch02
9781285852744 ppt ch029781285852744 ppt ch02
9781285852744 ppt ch02Terry Yoast
 
Code: from Procedural to Object Oriented
Code: from Procedural to Object OrientedCode: from Procedural to Object Oriented
Code: from Procedural to Object Orientedkleinron
 
Steps for Developing a 'C' program
 Steps for Developing a 'C' program Steps for Developing a 'C' program
Steps for Developing a 'C' programSahithi Naraparaju
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
Project 2 the second project involves/tutorialoutlet
Project 2 the second project involves/tutorialoutletProject 2 the second project involves/tutorialoutlet
Project 2 the second project involves/tutorialoutletMessanz
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 
9781285852744 ppt ch12
9781285852744 ppt ch129781285852744 ppt ch12
9781285852744 ppt ch12Terry Yoast
 
The process of programming
 The process of programming The process of programming
The process of programmingKopi Maheswaran
 
Decision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, StringsDecision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, StringsPrabu U
 
Functions ppt ch06
Functions ppt ch06Functions ppt ch06
Functions ppt ch06Terry Yoast
 
9781285852744 ppt ch10
9781285852744 ppt ch109781285852744 ppt ch10
9781285852744 ppt ch10Terry Yoast
 
Software code metrics
Software code metricsSoftware code metrics
Software code metricsPVS-Studio
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAAiman Hud
 

What's hot (19)

Principles of object oriented programing
Principles of object oriented programingPrinciples of object oriented programing
Principles of object oriented programing
 
9781285852744 ppt ch02
9781285852744 ppt ch029781285852744 ppt ch02
9781285852744 ppt ch02
 
Programming and problem solving with c++, 3rd edition
Programming and problem solving with c++, 3rd editionProgramming and problem solving with c++, 3rd edition
Programming and problem solving with c++, 3rd edition
 
C language
C languageC language
C language
 
Code: from Procedural to Object Oriented
Code: from Procedural to Object OrientedCode: from Procedural to Object Oriented
Code: from Procedural to Object Oriented
 
Steps for Developing a 'C' program
 Steps for Developing a 'C' program Steps for Developing a 'C' program
Steps for Developing a 'C' program
 
Chap 02-1
Chap 02-1Chap 02-1
Chap 02-1
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Project 2 the second project involves/tutorialoutlet
Project 2 the second project involves/tutorialoutletProject 2 the second project involves/tutorialoutlet
Project 2 the second project involves/tutorialoutlet
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 
Week10 final
Week10 finalWeek10 final
Week10 final
 
9781285852744 ppt ch12
9781285852744 ppt ch129781285852744 ppt ch12
9781285852744 ppt ch12
 
C language
C languageC language
C language
 
The process of programming
 The process of programming The process of programming
The process of programming
 
Decision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, StringsDecision Making Statements, Arrays, Strings
Decision Making Statements, Arrays, Strings
 
Functions ppt ch06
Functions ppt ch06Functions ppt ch06
Functions ppt ch06
 
9781285852744 ppt ch10
9781285852744 ppt ch109781285852744 ppt ch10
9781285852744 ppt ch10
 
Software code metrics
Software code metricsSoftware code metrics
Software code metrics
 
POLITEKNIK MALAYSIA
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
 

Viewers also liked

Uses of Cupcakes For Any Occasion in Hyderabad!
 Uses of Cupcakes For Any Occasion in Hyderabad! Uses of Cupcakes For Any Occasion in Hyderabad!
Uses of Cupcakes For Any Occasion in Hyderabad!bookthecake.com
 
Oop project briefing sem 1 2015 2016
Oop project briefing  sem 1 2015 2016Oop project briefing  sem 1 2015 2016
Oop project briefing sem 1 2015 2016IIUM
 
Functional programming principles and Java 8
Functional programming principles and Java 8Functional programming principles and Java 8
Functional programming principles and Java 8Dragos Balan
 
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 13 - Progra...
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 13 - Progra...Understanding Computers: Today and Tomorrow, 13th Edition Chapter 13 - Progra...
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 13 - Progra...yaminohime
 
Good Programming Practice
Good Programming PracticeGood Programming Practice
Good Programming PracticeBikalpa Gyawali
 
Functional Programming in Java - Code for Maintainability
Functional Programming in Java - Code for MaintainabilityFunctional Programming in Java - Code for Maintainability
Functional Programming in Java - Code for MaintainabilityMarcin Stepien
 
Why C is Called Structured Programming Language
Why C is Called Structured Programming LanguageWhy C is Called Structured Programming Language
Why C is Called Structured Programming LanguageSinbad Konick
 
Programming languages
Programming languagesProgramming languages
Programming languagesEelco Visser
 
Programming Languages and Program Develompent
Programming Languages and Program DevelompentProgramming Languages and Program Develompent
Programming Languages and Program DevelompentSamudin Kassan
 
Principles Of Programing Languages
Principles Of Programing LanguagesPrinciples Of Programing Languages
Principles Of Programing LanguagesMatthew McCullough
 
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 1 - Introdu...
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 1 - Introdu...Understanding Computers: Today and Tomorrow, 13th Edition Chapter 1 - Introdu...
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 1 - Introdu...yaminohime
 
5 structured programming
5 structured programming 5 structured programming
5 structured programming hccit
 
Guidelines for preparing internship report
Guidelines for preparing internship reportGuidelines for preparing internship report
Guidelines for preparing internship reportWINNERbd.it
 
Functional Programming In Java
Functional Programming In JavaFunctional Programming In Java
Functional Programming In JavaAndrei Solntsev
 
structured programming
structured programmingstructured programming
structured programmingAhmad54321
 

Viewers also liked (20)

Core FP Concepts
Core FP ConceptsCore FP Concepts
Core FP Concepts
 
Uses of Cupcakes For Any Occasion in Hyderabad!
 Uses of Cupcakes For Any Occasion in Hyderabad! Uses of Cupcakes For Any Occasion in Hyderabad!
Uses of Cupcakes For Any Occasion in Hyderabad!
 
Oop project briefing sem 1 2015 2016
Oop project briefing  sem 1 2015 2016Oop project briefing  sem 1 2015 2016
Oop project briefing sem 1 2015 2016
 
Functional programming principles and Java 8
Functional programming principles and Java 8Functional programming principles and Java 8
Functional programming principles and Java 8
 
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 13 - Progra...
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 13 - Progra...Understanding Computers: Today and Tomorrow, 13th Edition Chapter 13 - Progra...
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 13 - Progra...
 
Good Programming Practice
Good Programming PracticeGood Programming Practice
Good Programming Practice
 
Functional Programming in Java - Code for Maintainability
Functional Programming in Java - Code for MaintainabilityFunctional Programming in Java - Code for Maintainability
Functional Programming in Java - Code for Maintainability
 
Ada 95 - Structured programming
Ada 95 - Structured programmingAda 95 - Structured programming
Ada 95 - Structured programming
 
Why C is Called Structured Programming Language
Why C is Called Structured Programming LanguageWhy C is Called Structured Programming Language
Why C is Called Structured Programming Language
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Programming Languages and Program Develompent
Programming Languages and Program DevelompentProgramming Languages and Program Develompent
Programming Languages and Program Develompent
 
Functional programming in java
Functional programming in javaFunctional programming in java
Functional programming in java
 
Principles Of Programing Languages
Principles Of Programing LanguagesPrinciples Of Programing Languages
Principles Of Programing Languages
 
Input
InputInput
Input
 
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 1 - Introdu...
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 1 - Introdu...Understanding Computers: Today and Tomorrow, 13th Edition Chapter 1 - Introdu...
Understanding Computers: Today and Tomorrow, 13th Edition Chapter 1 - Introdu...
 
5 structured programming
5 structured programming 5 structured programming
5 structured programming
 
Guidelines for preparing internship report
Guidelines for preparing internship reportGuidelines for preparing internship report
Guidelines for preparing internship report
 
Functional Programming In Java
Functional Programming In JavaFunctional Programming In Java
Functional Programming In Java
 
Computer system
Computer systemComputer system
Computer system
 
structured programming
structured programmingstructured programming
structured programming
 

Similar to Csc1100 lecture01 ch01 pt2-paradigm

C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit orderMalikireddy Bramhananda Reddy
 
Fundamentals of programming with C++
Fundamentals of programming with C++Fundamentals of programming with C++
Fundamentals of programming with C++Seble Nigussie
 
Book management system
Book management systemBook management system
Book management systemSHARDA SHARAN
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEMMansi Tyagi
 
ch01_an overview of computers and programming languages
ch01_an overview of computers and programming languagesch01_an overview of computers and programming languages
ch01_an overview of computers and programming languagesLiemLe21
 
Stnotes doc 5
Stnotes doc 5Stnotes doc 5
Stnotes doc 5Alok Jain
 
C++ Programming Chapter 01
C++ Programming Chapter 01C++ Programming Chapter 01
C++ Programming Chapter 01Sourng Seng
 
Overview of c++
Overview of c++Overview of c++
Overview of c++geeeeeet
 
Chapter 1 - Basic concepts of programming.pdf
Chapter 1 - Basic concepts of programming.pdfChapter 1 - Basic concepts of programming.pdf
Chapter 1 - Basic concepts of programming.pdfKirubelWondwoson1
 
SULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notesSULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notesSULTHAN BASHA
 
Unit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introductionUnit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introductionAKR Education
 
Unit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptxUnit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptxSanketShah544615
 
Programming_Lecture_1.pptx
Programming_Lecture_1.pptxProgramming_Lecture_1.pptx
Programming_Lecture_1.pptxshoaibkhan716300
 
Computer Programming
Computer ProgrammingComputer Programming
Computer ProgrammingBurhan Fakhar
 
program development and paradigms
program development and paradigmsprogram development and paradigms
program development and paradigmskasenerd
 

Similar to Csc1100 lecture01 ch01 pt2-paradigm (20)

C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
C notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit orderC notes by m v b  reddy(gitam)imp  notes  all units notes  5 unit order
C notes by m v b reddy(gitam)imp notes all units notes 5 unit order
 
C AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDYC AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDY
 
Fundamentals of programming with C++
Fundamentals of programming with C++Fundamentals of programming with C++
Fundamentals of programming with C++
 
Book management system
Book management systemBook management system
Book management system
 
Notes of c programming 1st unit BCA I SEM
Notes of c programming  1st unit BCA I SEMNotes of c programming  1st unit BCA I SEM
Notes of c programming 1st unit BCA I SEM
 
ch01_an overview of computers and programming languages
ch01_an overview of computers and programming languagesch01_an overview of computers and programming languages
ch01_an overview of computers and programming languages
 
Stnotes doc 5
Stnotes doc 5Stnotes doc 5
Stnotes doc 5
 
C++ ch1
C++ ch1C++ ch1
C++ ch1
 
C++ Programming Chapter 01
C++ Programming Chapter 01C++ Programming Chapter 01
C++ Programming Chapter 01
 
Overview of c++
Overview of c++Overview of c++
Overview of c++
 
C tutorials
C tutorialsC tutorials
C tutorials
 
PROBLEM SOLVING
PROBLEM SOLVINGPROBLEM SOLVING
PROBLEM SOLVING
 
Chapter 1 - Basic concepts of programming.pdf
Chapter 1 - Basic concepts of programming.pdfChapter 1 - Basic concepts of programming.pdf
Chapter 1 - Basic concepts of programming.pdf
 
SULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notesSULTHAN's - C Programming Language notes
SULTHAN's - C Programming Language notes
 
Se
SeSe
Se
 
Unit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introductionUnit 1 of c++ part 1 basic introduction
Unit 1 of c++ part 1 basic introduction
 
Unit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptxUnit-2_Getting Started With ‘C’ Language (3).pptx
Unit-2_Getting Started With ‘C’ Language (3).pptx
 
Programming_Lecture_1.pptx
Programming_Lecture_1.pptxProgramming_Lecture_1.pptx
Programming_Lecture_1.pptx
 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
 
program development and paradigms
program development and paradigmsprogram development and paradigms
program development and paradigms
 

More from IIUM

How to use_000webhost
How to use_000webhostHow to use_000webhost
How to use_000webhostIIUM
 
Chapter 2
Chapter 2Chapter 2
Chapter 2IIUM
 
Chapter 1
Chapter 1Chapter 1
Chapter 1IIUM
 
Kreydle internship-multimedia
Kreydle internship-multimediaKreydle internship-multimedia
Kreydle internship-multimediaIIUM
 
03phpbldgblock
03phpbldgblock03phpbldgblock
03phpbldgblockIIUM
 
Chap2 practice key
Chap2 practice keyChap2 practice key
Chap2 practice keyIIUM
 
Group p1
Group p1Group p1
Group p1IIUM
 
Tutorial import n auto pilot blogspot friendly seo
Tutorial import n auto pilot blogspot friendly seoTutorial import n auto pilot blogspot friendly seo
Tutorial import n auto pilot blogspot friendly seoIIUM
 
Visual sceneperception encycloperception-sage-oliva2009
Visual sceneperception encycloperception-sage-oliva2009Visual sceneperception encycloperception-sage-oliva2009
Visual sceneperception encycloperception-sage-oliva2009IIUM
 
03 the htm_lforms
03 the htm_lforms03 the htm_lforms
03 the htm_lformsIIUM
 
Exercise on algo analysis answer
Exercise on algo analysis   answerExercise on algo analysis   answer
Exercise on algo analysis answerIIUM
 
Redo midterm
Redo midtermRedo midterm
Redo midtermIIUM
 
Heaps
HeapsHeaps
HeapsIIUM
 
Report format
Report formatReport format
Report formatIIUM
 
Edpuzzle guidelines
Edpuzzle guidelinesEdpuzzle guidelines
Edpuzzle guidelinesIIUM
 
Final Exam Paper
Final Exam PaperFinal Exam Paper
Final Exam PaperIIUM
 
Final Exam Paper
Final Exam PaperFinal Exam Paper
Final Exam PaperIIUM
 
Group assignment 1 s21516
Group assignment 1 s21516Group assignment 1 s21516
Group assignment 1 s21516IIUM
 
Avl tree-rotations
Avl tree-rotationsAvl tree-rotations
Avl tree-rotationsIIUM
 
Week12 graph
Week12   graph Week12   graph
Week12 graph IIUM
 

More from IIUM (20)

How to use_000webhost
How to use_000webhostHow to use_000webhost
How to use_000webhost
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Kreydle internship-multimedia
Kreydle internship-multimediaKreydle internship-multimedia
Kreydle internship-multimedia
 
03phpbldgblock
03phpbldgblock03phpbldgblock
03phpbldgblock
 
Chap2 practice key
Chap2 practice keyChap2 practice key
Chap2 practice key
 
Group p1
Group p1Group p1
Group p1
 
Tutorial import n auto pilot blogspot friendly seo
Tutorial import n auto pilot blogspot friendly seoTutorial import n auto pilot blogspot friendly seo
Tutorial import n auto pilot blogspot friendly seo
 
Visual sceneperception encycloperception-sage-oliva2009
Visual sceneperception encycloperception-sage-oliva2009Visual sceneperception encycloperception-sage-oliva2009
Visual sceneperception encycloperception-sage-oliva2009
 
03 the htm_lforms
03 the htm_lforms03 the htm_lforms
03 the htm_lforms
 
Exercise on algo analysis answer
Exercise on algo analysis   answerExercise on algo analysis   answer
Exercise on algo analysis answer
 
Redo midterm
Redo midtermRedo midterm
Redo midterm
 
Heaps
HeapsHeaps
Heaps
 
Report format
Report formatReport format
Report format
 
Edpuzzle guidelines
Edpuzzle guidelinesEdpuzzle guidelines
Edpuzzle guidelines
 
Final Exam Paper
Final Exam PaperFinal Exam Paper
Final Exam Paper
 
Final Exam Paper
Final Exam PaperFinal Exam Paper
Final Exam Paper
 
Group assignment 1 s21516
Group assignment 1 s21516Group assignment 1 s21516
Group assignment 1 s21516
 
Avl tree-rotations
Avl tree-rotationsAvl tree-rotations
Avl tree-rotations
 
Week12 graph
Week12   graph Week12   graph
Week12 graph
 

Recently uploaded

Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 

Recently uploaded (20)

Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 

Csc1100 lecture01 ch01 pt2-paradigm

  • 1. A First Book of C++ Chapter 1(Pt 2) Programming Design & Paradigm
  • 2. A First Book of C++ Programming Design
  • 3.  Step 1 - Analyze the problem  Outline the problem and its requirements  Design steps (algorithm) to solve the problem  Step 2 - Implement the algorithm  Implement the algorithm in code  Verify that the algorithm works  Step 3 - Maintenance  Use and modify the program if the problem domain changes Problem Solving Process (revisit) C++ Programming: From Problem Analysis to Program Design, Third Edition 3
  • 4.
  • 5.  Thoroughly understand the problem  Understand problem requirements  Does program require user interaction?  Does program manipulate data?  What is the output?  If the problem is complex, divide it into sub- problems  Analyze each sub-problem as above Analyze the Problem C++ Programming: From Problem Analysis to Program Design, Third Edition 5
  • 6.  If problem was broken into sub-problems  Design algorithms for each sub-problem  Check the correctness of algorithm  Can test using sample data  Some mathematical analysis might be required Design an Algorithm C++ Programming: From Problem Analysis to Program Design, Third Edition 6
  • 7.  Once the algorithm is designed and correctness verified  Write the equivalent code in high-level language  Type the program using text editor Write the Code C++ Programming: From Problem Analysis to Program Design, Third Edition 7
  • 8.  Run code through compiler  If compiler generates errors  Look at code and remove errors  Run code again through compiler  If there are no syntax errors  Compiler generates equivalent machine code  Linker links machine code with system resources Compiling and Linking C++ Programming: From Problem Analysis to Program Design, Third Edition 8
  • 9.  Once compiled and linked, loader can place program into main memory for execution  The final step is to execute the program  Compiler guarantees that the program follows the rules of the language  Does not guarantee that the program will run correctly The Loader and Executing C++ Programming: From Problem Analysis to Program Design, Third Edition 9
  • 10. A First Book of C++ Programming Paradigm
  • 11. Definition: A way of conceptualizing what it means to perform computation and how tasks to be carried out on the computer should be structured and organized. Programming Paradigm A First Book of C++ 4th Edition 11
  • 12.  General types of programming paradigms:  Structural  Imperative  Declarative  Procedural  Object-Oriented  Functional  Domain-Specific Programming Paradigm (cont'd.) A First Book of C++ 4th Edition 12
  • 13.  Structured programming (or modular programming) is a problem solving strategy and a programming methodology that includes the following guidelines:  The flow of control in the program should be as simple as possible.  The construction of a program should embody top-down design. Programming Paradigm (cont'd.) A First Book of C++ 4th Edition 13
  • 14.  Top-down design means:  It repeatedly decomposing a problem into smaller problems.  Eventually leads to:  a collection of small problems or tasks.  each can be easily coded Programming Paradigm (cont'd.) A First Book of C++ 4th Edition 14
  • 15.  Object-oriented programming is a method of programming based on a hierarchy of classes, and well-defined and cooperating objects.  A class is a structure that defines the data and the methods to work on that data.  In simple definition, a class is a programmer defined data type. Programming Paradigm (cont'd.) A First Book of C++ 4th Edition 15
  • 16.  Object-oriented programming (OOP) concepts are: Programming Paradigm (cont'd.) A First Book of C++ 4th Edition 16 Concepts Functions Data Abstraction specifies behavior Encapsulation controls visibility of names (data hiding) Polymorphism accommodates various implementations Inheritance facilitates code reuse Modularity relates to unit of compilation
  • 17. Structured vs. Object-Oriented Programming A First Book of C++ 4th Edition 17 Structured Programming: MAIN PROGRAM FUNCTION 3FUNCTION 2 GLOBAL DATA FUNCTION 5FUNCTION 4 FUNCTION 1
  • 18. Structured Programming:  Using functions.  Function & program is divided into modules.  Every module has its own data and function which can be called by other modules. Structured vs. Object-Oriented Programming A First Book of C++ 4th Edition 18
  • 19. Structured vs. Object-Oriented Programming (cont'd.) A First Book of C++ 4th Edition 19 Object-Oriented Programming: Object 1 Object 2 Data Function Data Function Object 3 Data Function
  • 20. Object-Oriented Programming:  Objects have both data and methods.  Objects of the same class have the same data elements and methods.  Objects send and receive messages to invoke actions. Structured vs. Object-Oriented Programming A First Book of C++ 4th Edition 20
  • 21.  Data object  Set of values packaged as single unit (e.g., student’s name & grade)  Class  Set of objects with similar attributes  General concept of object-oriented programming is the difference between an object and the larger set of which it is a member (class)  A red Ford is an instance, or object, of a general class of automobiles or cars Classes and Objects A First Book of C++ 4th Edition 21