SlideShare a Scribd company logo
Revision
Michael Heron
Introduction
• In today’s lecture we are going to round off our discussion of
programming with a revision of topics.
• The theoretical side of these at least.
• This relates to the examination portion of the module.
• Important to understand the concepts for this.
• Code of secondary importance.
What Is A Program?
• A program is a series of statements to the computer.
• Computers are stupid
• Humans are clever
• Need to ‘talk down’ to the computer
• Process of arriving at a working program very complicated.
• Involves the interaction of many skills.
Representing Information
• Information in a computer program is represented by
variables.
• These are stored in the computer’s memory.
• Variables stand in place of literal values.
• We don’t know what they will be when we run the program.
• Used to deal with ambiguity.
• Can be many different types.
Flow of Execution
• All programs have a flow of execution.
• This determines in what order the code statements are executed.
• By default, flow of execution is sequential.
• Statements are executed one after the other.
• We have access to many flow control operations to change
that.
• These permit us to change the order in which code is executed.
Flow of Execution
• Repetition structures are used to repeat sections of code.
• They fall into two categories.
• Unbounded loops, when we don’t know how many times to
iterate.
• Bounded loops, when we do.
• For loops are bounded loops.
• While loops are unbounded loops.
• Also exist a do-while loop, with more situational use.
Flow of Execution
• Selection structures allow us to choose between different
paths of execution.
• If lets us provide code that might be executed if conditions are
met.
• If-else lets us provide between two mutually exclusive course of
action.
• If-Else if allows for more fine-grained control.
• Switch statement exists as a syntactic nicety.
• It makes code more readable.
Arrays
• Representing data as single variables very limited.
• Many real world situations require something more
comprehensive.
• Arrays exist as a collection of related data.
• A list of names, a list of ages, etc
• Arrays are syntatically amenable to manipulation with other
structures.
• For loops in particular.
Arrays
• Arrays serve as the basis for more complicated data
structures.
• They can be 1D, 2D, or as many dimensions as we like.
• Arrays are made up of elements which are identified by
indices.
• The number of indices is dependant on how many dimensions
the array has.
• It’s like a variable with many different compartments.
Functions
• Incorporating all program code into a single main function is
very limited.
• Hard to write
• Hard to read
• Hard to maintain
• Functions allow us to split up the functionality between
smaller units.
• Functions, or methods
• Same thing with different names.
Functions
• Functions are uniquely identified by their signatures.
• Their name, and the order and type of their parameters.
• Parameters get sent into functions as a way of providing
information.
• Functions can return a value to their calling function.
• To give information back.
Functions and Variables
• Functions introduce a new issue with regards to variables.
• That of Scope
• In a program, variables have one of three kinds of scope.
• Local
• Global
• Class-wide
Pointers
• Variables represent an abstraction.
• They are not the memory addresses, but the contents of the
memory addresses.
• Pointers allow us to access memory locations directly.
• Useful for several reasons.
• Works through the use of two operators
• *, which is the dereference operator
• &, which is the reference operator.
Program Correctness
• Most programs are not very correct.
• They crash, or misbehave.
• It’s very hard to create correct computer programs.
• Beyond the ability of Mortal Ken
• This a direct result of the way digital data is represented.
• We can take a structured, systematic approach to this.
• By creating and following a testing strategy
Testing
• Testing breaks down into two key families.
• Black box testing, which tests only inputs and outputs.
• White box testing, which tests only the flow of execution through
the program.
• Testing based on the creation of test cases.
• These stress ‘high risk’ parts of the system.
• A good testing strategy is one designed to uncover flaws.
Debugging
• Getting a program running is the easy thing.
• Getting it working is more difficult.
• Debugging is a complex task requiring patience and a
particular mindset.
• It involves tracking down often complex misbehavior.
• It is a process intricately linked to programming.
• But a separate and distinct step.
Objects
• C++ is an object oriented language.
• This introduces new difficulties in development.
• Object oriented programming is built on two main structures.
• The class, which is a blueprint
• The object, which is a specific instance of a class.
• Classes define our structural side of the program.
• Objects define our dynamic side.
Objects and Classes
• Classes sit idle until we create objects from them.
• This process is called instantiation.
• The class defines the structure.
• The attributes
• The methods
• The object defines the state.
• The value each of the attributes has.
Encapsulation
• Good object design is very difficult.
• It takes years and years of practise and making mistakes.
• Some principles exist to aid in design.
• Encapsulation is the principle of tying data and the methods that act
on that data together.
• We can protect the delicate innards of an object using visibility
modifiers on the data.
• Private, Public, Protected
• The set of public methods exposed defines the object’s interface.
Inheritance
• Inheritance is the technique of allowing one class to
incorporate methods and attributes defined in another.
• The child class inherits the methods and attributes of the parent.
• Useful for many reasons.
• Maintenance
• Reusability
• Cohesion of interface
Object Design
• Hard to assess a particular object hierarchy.
• Some metrics exist
• Cohesion
• Coupling
• Impact of Change
• Important to create objects in the right way.
• Black box design
• Incorporate placeholders
• Compile early and often
File Handling
• Input and Output in C++ is handled via streams for the most
part.
• cout and cin are examples of streams.
• File I/O in C++ is handled as an extension of this idea.
• Create an appropriate object
• Manipulate it using << and >>
• Close it when you’re done
Stream I/O
• Streams in C++ are very versatile.
• They can be manipulated using stream manipulators.
• Techniques are shared between keyboard / monitor I/O and
file I/O
• What works for one will work for the other.
• This is powered by inheritance.
• They all inherit from the same basic structure.
Parsing
• Most of the data you pull into a system will not be in a format
suitable for processing.
• Necessary to parse data into a suitable format.
• Various parsing routines exist.
• Tokenization
• Object representation
• Data conversion
• Usually necessary to ‘roll your own’
• Data representation is too important to leave to ‘off the shelf’
solutions.
Summary
• Summarising a summary of the module is a crazy thing to do
• So instead I will put some jokes.
• Two fish are in a tank. One turns to the other and says ‘Do you
know how to drive this thing?’
• The other says ‘My word! A talking fish!’
• Have you heard about the new pirate movie? It’s rated
AaaaAaaaaAaarrrrRrr!

More Related Content

What's hot

Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1
Jamshid Hashimi
 
Object-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & ProgrammingObject-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & Programming
Allan Mangune
 
UML
UMLUML
Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)
Asfand Hassan
 
OOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented ProgrammingOOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented Programming
dkpawar
 
C++ in object oriented programming
C++ in object oriented programmingC++ in object oriented programming
C++ in object oriented programming
Saket Khopkar
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
Amar Jukuntla
 
C++ chapter 1
C++ chapter 1C++ chapter 1
C++ chapter 1
jasvinder162
 
Principal of objected oriented programming
Principal of objected oriented programming Principal of objected oriented programming
Principal of objected oriented programming
Rokonuzzaman Rony
 
Reading Notes : the practice of programming
Reading Notes : the practice of programmingReading Notes : the practice of programming
Reading Notes : the practice of programming
Juggernaut Liu
 

What's hot (10)

Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1Week 1: Getting Your Hands Dirty - Part 1
Week 1: Getting Your Hands Dirty - Part 1
 
Object-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & ProgrammingObject-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & Programming
 
UML
UMLUML
UML
 
Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)Oop lec 2(introduction to object oriented technology)
Oop lec 2(introduction to object oriented technology)
 
OOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented ProgrammingOOP Unit 1 - Foundation of Object- Oriented Programming
OOP Unit 1 - Foundation of Object- Oriented Programming
 
C++ in object oriented programming
C++ in object oriented programmingC++ in object oriented programming
C++ in object oriented programming
 
Need of object oriented programming
Need of object oriented programmingNeed of object oriented programming
Need of object oriented programming
 
C++ chapter 1
C++ chapter 1C++ chapter 1
C++ chapter 1
 
Principal of objected oriented programming
Principal of objected oriented programming Principal of objected oriented programming
Principal of objected oriented programming
 
Reading Notes : the practice of programming
Reading Notes : the practice of programmingReading Notes : the practice of programming
Reading Notes : the practice of programming
 

Viewers also liked

CPP02 - The Structure of a Program
CPP02 - The Structure of a ProgramCPP02 - The Structure of a Program
CPP02 - The Structure of a Program
Michael Heron
 
CPP09 - Testing
CPP09 - TestingCPP09 - Testing
CPP09 - Testing
Michael Heron
 
CPP07 - Scope
CPP07 - ScopeCPP07 - Scope
CPP07 - Scope
Michael Heron
 
CPP04 - Selection
CPP04 - SelectionCPP04 - Selection
CPP04 - Selection
Michael Heron
 
Representation of geometric figuers in Braille
Representation of  geometric figuers in BrailleRepresentation of  geometric figuers in Braille
Representation of geometric figuers in Braille
BIJIT GHOSH
 
CPP08 - Pointers
CPP08 - PointersCPP08 - Pointers
CPP08 - Pointers
Michael Heron
 
CPP01 - Introduction to C++
CPP01 - Introduction to C++CPP01 - Introduction to C++
CPP01 - Introduction to C++
Michael Heron
 
CPP03 - Repetition
CPP03 - RepetitionCPP03 - Repetition
CPP03 - Repetition
Michael Heron
 
CPP10 - Debugging
CPP10 - DebuggingCPP10 - Debugging
CPP10 - Debugging
Michael Heron
 
CPP12 - Algorithms
CPP12 - AlgorithmsCPP12 - Algorithms
CPP12 - Algorithms
Michael Heron
 
Secure communication in Networking
Secure communication in NetworkingSecure communication in Networking
Secure communication in Networking
anita maharjan
 
CPP05 - Arrays
CPP05 - ArraysCPP05 - Arrays
CPP05 - Arrays
Michael Heron
 
CPP06 - Functions
CPP06 - FunctionsCPP06 - Functions
CPP06 - Functions
Michael Heron
 
CPP11 - Function Design
CPP11 - Function DesignCPP11 - Function Design
CPP11 - Function Design
Michael Heron
 
PHAME: Principles of Hierarchy Abstraction Modularization and Encapsulation
PHAME: Principles of Hierarchy Abstraction Modularization and EncapsulationPHAME: Principles of Hierarchy Abstraction Modularization and Encapsulation
PHAME: Principles of Hierarchy Abstraction Modularization and Encapsulation
Tushar Sharma
 
Refactoring for Design Smells - ICSE 2014 Tutorial
Refactoring for Design Smells - ICSE 2014 TutorialRefactoring for Design Smells - ICSE 2014 Tutorial
Refactoring for Design Smells - ICSE 2014 Tutorial
Tushar Sharma
 
Comparison Study of Decision Tree Ensembles for Regression
Comparison Study of Decision Tree Ensembles for RegressionComparison Study of Decision Tree Ensembles for Regression
Comparison Study of Decision Tree Ensembles for Regression
Seonho Park
 
Handwritten Character Recognition
Handwritten Character RecognitionHandwritten Character Recognition
Handwritten Character Recognition
Constantine Priemski
 
CPP14 - Encapsulation
CPP14 - EncapsulationCPP14 - Encapsulation
CPP14 - Encapsulation
Michael Heron
 
Does your design smell?
Does your design smell?Does your design smell?
Does your design smell?
Tushar Sharma
 

Viewers also liked (20)

CPP02 - The Structure of a Program
CPP02 - The Structure of a ProgramCPP02 - The Structure of a Program
CPP02 - The Structure of a Program
 
CPP09 - Testing
CPP09 - TestingCPP09 - Testing
CPP09 - Testing
 
CPP07 - Scope
CPP07 - ScopeCPP07 - Scope
CPP07 - Scope
 
CPP04 - Selection
CPP04 - SelectionCPP04 - Selection
CPP04 - Selection
 
Representation of geometric figuers in Braille
Representation of  geometric figuers in BrailleRepresentation of  geometric figuers in Braille
Representation of geometric figuers in Braille
 
CPP08 - Pointers
CPP08 - PointersCPP08 - Pointers
CPP08 - Pointers
 
CPP01 - Introduction to C++
CPP01 - Introduction to C++CPP01 - Introduction to C++
CPP01 - Introduction to C++
 
CPP03 - Repetition
CPP03 - RepetitionCPP03 - Repetition
CPP03 - Repetition
 
CPP10 - Debugging
CPP10 - DebuggingCPP10 - Debugging
CPP10 - Debugging
 
CPP12 - Algorithms
CPP12 - AlgorithmsCPP12 - Algorithms
CPP12 - Algorithms
 
Secure communication in Networking
Secure communication in NetworkingSecure communication in Networking
Secure communication in Networking
 
CPP05 - Arrays
CPP05 - ArraysCPP05 - Arrays
CPP05 - Arrays
 
CPP06 - Functions
CPP06 - FunctionsCPP06 - Functions
CPP06 - Functions
 
CPP11 - Function Design
CPP11 - Function DesignCPP11 - Function Design
CPP11 - Function Design
 
PHAME: Principles of Hierarchy Abstraction Modularization and Encapsulation
PHAME: Principles of Hierarchy Abstraction Modularization and EncapsulationPHAME: Principles of Hierarchy Abstraction Modularization and Encapsulation
PHAME: Principles of Hierarchy Abstraction Modularization and Encapsulation
 
Refactoring for Design Smells - ICSE 2014 Tutorial
Refactoring for Design Smells - ICSE 2014 TutorialRefactoring for Design Smells - ICSE 2014 Tutorial
Refactoring for Design Smells - ICSE 2014 Tutorial
 
Comparison Study of Decision Tree Ensembles for Regression
Comparison Study of Decision Tree Ensembles for RegressionComparison Study of Decision Tree Ensembles for Regression
Comparison Study of Decision Tree Ensembles for Regression
 
Handwritten Character Recognition
Handwritten Character RecognitionHandwritten Character Recognition
Handwritten Character Recognition
 
CPP14 - Encapsulation
CPP14 - EncapsulationCPP14 - Encapsulation
CPP14 - Encapsulation
 
Does your design smell?
Does your design smell?Does your design smell?
Does your design smell?
 

Similar to CPP19 - Revision

Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithms
iqbalphy1
 
CPP16 - Object Design
CPP16 - Object DesignCPP16 - Object Design
CPP16 - Object Design
Michael Heron
 
2CPP19 - Summation
2CPP19 - Summation2CPP19 - Summation
2CPP19 - Summation
Michael Heron
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
IndraKhatri
 
Algorithms and Data Structures
Algorithms and Data StructuresAlgorithms and Data Structures
Algorithms and Data Structures
sonykhan3
 
Software Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptxSoftware Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptx
gauriVarshney8
 
Data structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdfData structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdf
DukeCalvin
 
Chapter 1
Chapter 1Chapter 1
Intro to Data Structure & Algorithms
Intro to Data Structure & AlgorithmsIntro to Data Structure & Algorithms
Intro to Data Structure & Algorithms
Akhil Kaushik
 
73d32 session1 c++
73d32 session1 c++73d32 session1 c++
73d32 session1 c++
Mukund Trivedi
 
PPL, OQL & oodbms
PPL, OQL & oodbmsPPL, OQL & oodbms
PPL, OQL & oodbms
ramandeep brar
 
Programming in the large
Programming in the largeProgramming in the large
Programming in the large
Naveenkumar Muguda
 
OOP -interface and objects.pptx
OOP -interface and objects.pptxOOP -interface and objects.pptx
OOP -interface and objects.pptx
EdFeranil
 
Scheduling Thread
Scheduling  ThreadScheduling  Thread
Scheduling Thread
MuhammadBilal187526
 
Clean code presentation
Clean code presentationClean code presentation
Clean code presentation
Bhavin Gandhi
 
Design engineering cohesion by dinesh
Design engineering cohesion by dineshDesign engineering cohesion by dinesh
Design engineering cohesion by dinesh
Dinesh Kumar
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remani
jaxconf
 
Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)
Vijayananda Ratnam Ch
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling Software
Abdelmonaim Remani
 
2CPP11 - Method Overloading
2CPP11 - Method Overloading2CPP11 - Method Overloading
2CPP11 - Method Overloading
Michael Heron
 

Similar to CPP19 - Revision (20)

Data Structure and Algorithms
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithms
 
CPP16 - Object Design
CPP16 - Object DesignCPP16 - Object Design
CPP16 - Object Design
 
2CPP19 - Summation
2CPP19 - Summation2CPP19 - Summation
2CPP19 - Summation
 
Lecture 1.pptx
Lecture 1.pptxLecture 1.pptx
Lecture 1.pptx
 
Algorithms and Data Structures
Algorithms and Data StructuresAlgorithms and Data Structures
Algorithms and Data Structures
 
Software Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptxSoftware Eng S3 ( Software Design ).pptx
Software Eng S3 ( Software Design ).pptx
 
Data structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdfData structures and algorithms Module-1.pdf
Data structures and algorithms Module-1.pdf
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Intro to Data Structure & Algorithms
Intro to Data Structure & AlgorithmsIntro to Data Structure & Algorithms
Intro to Data Structure & Algorithms
 
73d32 session1 c++
73d32 session1 c++73d32 session1 c++
73d32 session1 c++
 
PPL, OQL & oodbms
PPL, OQL & oodbmsPPL, OQL & oodbms
PPL, OQL & oodbms
 
Programming in the large
Programming in the largeProgramming in the large
Programming in the large
 
OOP -interface and objects.pptx
OOP -interface and objects.pptxOOP -interface and objects.pptx
OOP -interface and objects.pptx
 
Scheduling Thread
Scheduling  ThreadScheduling  Thread
Scheduling Thread
 
Clean code presentation
Clean code presentationClean code presentation
Clean code presentation
 
Design engineering cohesion by dinesh
Design engineering cohesion by dineshDesign engineering cohesion by dinesh
Design engineering cohesion by dinesh
 
The economies of scaling software - Abdel Remani
The economies of scaling software - Abdel RemaniThe economies of scaling software - Abdel Remani
The economies of scaling software - Abdel Remani
 
Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)Introduction to Database Management Systems (DBMS)
Introduction to Database Management Systems (DBMS)
 
The Economies of Scaling Software
The Economies of Scaling SoftwareThe Economies of Scaling Software
The Economies of Scaling Software
 
2CPP11 - Method Overloading
2CPP11 - Method Overloading2CPP11 - Method Overloading
2CPP11 - Method Overloading
 

More from Michael Heron

Meeple centred design - Board Game Accessibility
Meeple centred design - Board Game AccessibilityMeeple centred design - Board Game Accessibility
Meeple centred design - Board Game Accessibility
Michael Heron
 
Musings on misconduct
Musings on misconductMusings on misconduct
Musings on misconduct
Michael Heron
 
Accessibility Support with the ACCESS Framework
Accessibility Support with the ACCESS FrameworkAccessibility Support with the ACCESS Framework
Accessibility Support with the ACCESS Framework
Michael Heron
 
ACCESS: A Technical Framework for Adaptive Accessibility Support
ACCESS:  A Technical Framework for Adaptive Accessibility SupportACCESS:  A Technical Framework for Adaptive Accessibility Support
ACCESS: A Technical Framework for Adaptive Accessibility Support
Michael Heron
 
Authorship and Autership
Authorship and AutershipAuthorship and Autership
Authorship and Autership
Michael Heron
 
Text parser based interaction
Text parser based interactionText parser based interaction
Text parser based interaction
Michael Heron
 
SAD04 - Inheritance
SAD04 - InheritanceSAD04 - Inheritance
SAD04 - Inheritance
Michael Heron
 
GRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and RadiosityGRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and Radiosity
Michael Heron
 
GRPHICS07 - Textures
GRPHICS07 - TexturesGRPHICS07 - Textures
GRPHICS07 - Textures
Michael Heron
 
GRPHICS06 - Shading
GRPHICS06 - ShadingGRPHICS06 - Shading
GRPHICS06 - Shading
Michael Heron
 
GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)
Michael Heron
 
GRPHICS04 - Rendering (1)
GRPHICS04 - Rendering (1)GRPHICS04 - Rendering (1)
GRPHICS04 - Rendering (1)
Michael Heron
 
GRPHICS03 - Graphical Representation
GRPHICS03 - Graphical RepresentationGRPHICS03 - Graphical Representation
GRPHICS03 - Graphical Representation
Michael Heron
 
GRPHICS02 - Creating 3D Graphics
GRPHICS02 - Creating 3D GraphicsGRPHICS02 - Creating 3D Graphics
GRPHICS02 - Creating 3D Graphics
Michael Heron
 
GRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsGRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D Graphics
Michael Heron
 
GRPHICS09 - Art Appreciation
GRPHICS09 - Art AppreciationGRPHICS09 - Art Appreciation
GRPHICS09 - Art Appreciation
Michael Heron
 
2CPP18 - Modifiers
2CPP18 - Modifiers2CPP18 - Modifiers
2CPP18 - Modifiers
Michael Heron
 
2CPP17 - File IO
2CPP17 - File IO2CPP17 - File IO
2CPP17 - File IO
Michael Heron
 
2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
Michael Heron
 
2CPP15 - Templates
2CPP15 - Templates2CPP15 - Templates
2CPP15 - Templates
Michael Heron
 

More from Michael Heron (20)

Meeple centred design - Board Game Accessibility
Meeple centred design - Board Game AccessibilityMeeple centred design - Board Game Accessibility
Meeple centred design - Board Game Accessibility
 
Musings on misconduct
Musings on misconductMusings on misconduct
Musings on misconduct
 
Accessibility Support with the ACCESS Framework
Accessibility Support with the ACCESS FrameworkAccessibility Support with the ACCESS Framework
Accessibility Support with the ACCESS Framework
 
ACCESS: A Technical Framework for Adaptive Accessibility Support
ACCESS:  A Technical Framework for Adaptive Accessibility SupportACCESS:  A Technical Framework for Adaptive Accessibility Support
ACCESS: A Technical Framework for Adaptive Accessibility Support
 
Authorship and Autership
Authorship and AutershipAuthorship and Autership
Authorship and Autership
 
Text parser based interaction
Text parser based interactionText parser based interaction
Text parser based interaction
 
SAD04 - Inheritance
SAD04 - InheritanceSAD04 - Inheritance
SAD04 - Inheritance
 
GRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and RadiosityGRPHICS08 - Raytracing and Radiosity
GRPHICS08 - Raytracing and Radiosity
 
GRPHICS07 - Textures
GRPHICS07 - TexturesGRPHICS07 - Textures
GRPHICS07 - Textures
 
GRPHICS06 - Shading
GRPHICS06 - ShadingGRPHICS06 - Shading
GRPHICS06 - Shading
 
GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)GRPHICS05 - Rendering (2)
GRPHICS05 - Rendering (2)
 
GRPHICS04 - Rendering (1)
GRPHICS04 - Rendering (1)GRPHICS04 - Rendering (1)
GRPHICS04 - Rendering (1)
 
GRPHICS03 - Graphical Representation
GRPHICS03 - Graphical RepresentationGRPHICS03 - Graphical Representation
GRPHICS03 - Graphical Representation
 
GRPHICS02 - Creating 3D Graphics
GRPHICS02 - Creating 3D GraphicsGRPHICS02 - Creating 3D Graphics
GRPHICS02 - Creating 3D Graphics
 
GRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D GraphicsGRPHICS01 - Introduction to 3D Graphics
GRPHICS01 - Introduction to 3D Graphics
 
GRPHICS09 - Art Appreciation
GRPHICS09 - Art AppreciationGRPHICS09 - Art Appreciation
GRPHICS09 - Art Appreciation
 
2CPP18 - Modifiers
2CPP18 - Modifiers2CPP18 - Modifiers
2CPP18 - Modifiers
 
2CPP17 - File IO
2CPP17 - File IO2CPP17 - File IO
2CPP17 - File IO
 
2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
 
2CPP15 - Templates
2CPP15 - Templates2CPP15 - Templates
2CPP15 - Templates
 

Recently uploaded

socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
dakas1
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
Remote DBA Services
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
Rakesh Kumar R
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
brainerhub1
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
Bert Jan Schrijver
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
Alina Yurenko
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
Drona Infotech
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
Alberto Brandolini
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
sjcobrien
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 

Recently uploaded (20)

socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
Oracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptxOracle 23c New Features For DBAs and Developers.pptx
Oracle 23c New Features For DBAs and Developers.pptx
 
What next after learning python programming basics
What next after learning python programming basicsWhat next after learning python programming basics
What next after learning python programming basics
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Unveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdfUnveiling the Advantages of Agile Software Development.pdf
Unveiling the Advantages of Agile Software Development.pdf
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
J-Spring 2024 - Going serverless with Quarkus, GraalVM native images and AWS ...
 
All you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVMAll you need to know about Spring Boot and GraalVM
All you need to know about Spring Boot and GraalVM
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
Mobile app Development Services | Drona Infotech
Mobile app Development Services  | Drona InfotechMobile app Development Services  | Drona Infotech
Mobile app Development Services | Drona Infotech
 
Modelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - AmsterdamModelling Up - DDDEurope 2024 - Amsterdam
Modelling Up - DDDEurope 2024 - Amsterdam
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Malibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed RoundMalibou Pitch Deck For Its €3M Seed Round
Malibou Pitch Deck For Its €3M Seed Round
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 

CPP19 - Revision

  • 2. Introduction • In today’s lecture we are going to round off our discussion of programming with a revision of topics. • The theoretical side of these at least. • This relates to the examination portion of the module. • Important to understand the concepts for this. • Code of secondary importance.
  • 3. What Is A Program? • A program is a series of statements to the computer. • Computers are stupid • Humans are clever • Need to ‘talk down’ to the computer • Process of arriving at a working program very complicated. • Involves the interaction of many skills.
  • 4. Representing Information • Information in a computer program is represented by variables. • These are stored in the computer’s memory. • Variables stand in place of literal values. • We don’t know what they will be when we run the program. • Used to deal with ambiguity. • Can be many different types.
  • 5. Flow of Execution • All programs have a flow of execution. • This determines in what order the code statements are executed. • By default, flow of execution is sequential. • Statements are executed one after the other. • We have access to many flow control operations to change that. • These permit us to change the order in which code is executed.
  • 6. Flow of Execution • Repetition structures are used to repeat sections of code. • They fall into two categories. • Unbounded loops, when we don’t know how many times to iterate. • Bounded loops, when we do. • For loops are bounded loops. • While loops are unbounded loops. • Also exist a do-while loop, with more situational use.
  • 7. Flow of Execution • Selection structures allow us to choose between different paths of execution. • If lets us provide code that might be executed if conditions are met. • If-else lets us provide between two mutually exclusive course of action. • If-Else if allows for more fine-grained control. • Switch statement exists as a syntactic nicety. • It makes code more readable.
  • 8. Arrays • Representing data as single variables very limited. • Many real world situations require something more comprehensive. • Arrays exist as a collection of related data. • A list of names, a list of ages, etc • Arrays are syntatically amenable to manipulation with other structures. • For loops in particular.
  • 9. Arrays • Arrays serve as the basis for more complicated data structures. • They can be 1D, 2D, or as many dimensions as we like. • Arrays are made up of elements which are identified by indices. • The number of indices is dependant on how many dimensions the array has. • It’s like a variable with many different compartments.
  • 10. Functions • Incorporating all program code into a single main function is very limited. • Hard to write • Hard to read • Hard to maintain • Functions allow us to split up the functionality between smaller units. • Functions, or methods • Same thing with different names.
  • 11. Functions • Functions are uniquely identified by their signatures. • Their name, and the order and type of their parameters. • Parameters get sent into functions as a way of providing information. • Functions can return a value to their calling function. • To give information back.
  • 12. Functions and Variables • Functions introduce a new issue with regards to variables. • That of Scope • In a program, variables have one of three kinds of scope. • Local • Global • Class-wide
  • 13. Pointers • Variables represent an abstraction. • They are not the memory addresses, but the contents of the memory addresses. • Pointers allow us to access memory locations directly. • Useful for several reasons. • Works through the use of two operators • *, which is the dereference operator • &, which is the reference operator.
  • 14. Program Correctness • Most programs are not very correct. • They crash, or misbehave. • It’s very hard to create correct computer programs. • Beyond the ability of Mortal Ken • This a direct result of the way digital data is represented. • We can take a structured, systematic approach to this. • By creating and following a testing strategy
  • 15. Testing • Testing breaks down into two key families. • Black box testing, which tests only inputs and outputs. • White box testing, which tests only the flow of execution through the program. • Testing based on the creation of test cases. • These stress ‘high risk’ parts of the system. • A good testing strategy is one designed to uncover flaws.
  • 16. Debugging • Getting a program running is the easy thing. • Getting it working is more difficult. • Debugging is a complex task requiring patience and a particular mindset. • It involves tracking down often complex misbehavior. • It is a process intricately linked to programming. • But a separate and distinct step.
  • 17. Objects • C++ is an object oriented language. • This introduces new difficulties in development. • Object oriented programming is built on two main structures. • The class, which is a blueprint • The object, which is a specific instance of a class. • Classes define our structural side of the program. • Objects define our dynamic side.
  • 18. Objects and Classes • Classes sit idle until we create objects from them. • This process is called instantiation. • The class defines the structure. • The attributes • The methods • The object defines the state. • The value each of the attributes has.
  • 19. Encapsulation • Good object design is very difficult. • It takes years and years of practise and making mistakes. • Some principles exist to aid in design. • Encapsulation is the principle of tying data and the methods that act on that data together. • We can protect the delicate innards of an object using visibility modifiers on the data. • Private, Public, Protected • The set of public methods exposed defines the object’s interface.
  • 20. Inheritance • Inheritance is the technique of allowing one class to incorporate methods and attributes defined in another. • The child class inherits the methods and attributes of the parent. • Useful for many reasons. • Maintenance • Reusability • Cohesion of interface
  • 21. Object Design • Hard to assess a particular object hierarchy. • Some metrics exist • Cohesion • Coupling • Impact of Change • Important to create objects in the right way. • Black box design • Incorporate placeholders • Compile early and often
  • 22. File Handling • Input and Output in C++ is handled via streams for the most part. • cout and cin are examples of streams. • File I/O in C++ is handled as an extension of this idea. • Create an appropriate object • Manipulate it using << and >> • Close it when you’re done
  • 23. Stream I/O • Streams in C++ are very versatile. • They can be manipulated using stream manipulators. • Techniques are shared between keyboard / monitor I/O and file I/O • What works for one will work for the other. • This is powered by inheritance. • They all inherit from the same basic structure.
  • 24. Parsing • Most of the data you pull into a system will not be in a format suitable for processing. • Necessary to parse data into a suitable format. • Various parsing routines exist. • Tokenization • Object representation • Data conversion • Usually necessary to ‘roll your own’ • Data representation is too important to leave to ‘off the shelf’ solutions.
  • 25. Summary • Summarising a summary of the module is a crazy thing to do • So instead I will put some jokes. • Two fish are in a tank. One turns to the other and says ‘Do you know how to drive this thing?’ • The other says ‘My word! A talking fish!’ • Have you heard about the new pirate movie? It’s rated AaaaAaaaaAaarrrrRrr!