SlideShare ist ein Scribd-Unternehmen logo
1 von 19
PROGRAMMING
PRIMER AND
CONCEPTS OF
OBJECT ORIENTED
PROGRAMMING
THEORY SESSION
A Programme Under the Compumitra Education Series
OUTLINE
• Programming Concepts
• Programming Logic
• Program Running
• Components of a Program
• Programming Paradigms
• Structured Programming
• Object Oriented Programming.
• Inheritance.
• Encapsulation and Abstraction
• Polymorphism and Overloading
• Architectural model
Programming Concepts
• Programming: Predefined way of telling the computer that what task is to be
performed. Also defined as sequence of instructions.
• Computer Languages: Predefined system of Set of Instructions that a computer
accepts.
– High Level Programming Languages: Usually English Like Instruction set with a
power to build application logic. Usually have an extremely strict syntax rules.
e.g. C, Java, C++, C# etc.
– Low Level Programming Languages: Set of Hardware related Mnemonics for
direct control over processing and input/output functions. E.g. Assembly
Language
– Formatting and Interface Languages: Languages made primarily for the
purpose of User side rendering of information. E.g. HTML, DHTML, XML Etc.
– Data Query Languages: Languages to get and post to structured system of
records called a database. SQL etc.
– Data Definition Languages: Languages to define properties of Data or any type
of content items. E.g. XML Schema (XSD), SQL-DDL (create table etc.)
Programming Logic
• Logic/Algorithm: Formulation Involved
in performing a task. For e.g.
– Fahrenheit to Celsius Conversion Formula.
– Writing of Data in a file one character at a
time or one block at a time.
– Compression of image file to a smaller size file.
– Method of following a protocol such as the
HTTP protocol.
Usually these words are interchangeably used
but the word algorithm is more suitable for
specific tasks now performed as a routine for
e.g. image compression is more appropriately
called algorithm while writing to a file may
just be called a simple logic.
Program Running
• Interpretation:
– Process of parsing the program instructions one by one
so that it directly produces the desired output.
– For e.g. Javascript is interpreted at the browser to run
the given functionality.
– Errors in the program code are caught at the time of
running the program and are likely hinder application
workflow.
• Compilation:
– Process of parsing the program instructions in one go
and produce an intermediate file that can be directly
run by the host system.
– Errors are required to be removed before compilation is
successfully completed.
– Application workflow is usually not hindered as basic
errors are removed initially. Only unexpected input
conditions produce errors.
Programming Instruction Purposes
• The Primary Purposes of
Programming Instructions are.
– To take Input.
– To give Output
– To perform operations.
– To run a program section based on
a condition selection.
– To repeat a section of code based
on condition.
Think that a computer is a generic
machine that can emulate other
machines based on the program it
runs.
INPUT
OUTPUT
OPERATE
SELECTION
REPETITION
/* add.c simple C program */
#include <stdio.h>
#define LAST 10
int main()
{
int i, sum = 0;
for ( i = 1; i <= LAST; i++)
{
sum += i;
}
printf("sum = %dn", sum);
return 0;
}
Programming Components (Tokens)
Keywords: The instruction
words used in a certain
language. For eg. INT, IF, THEN,
DO, NEXT, RETURN etc.
Comments:Text not to be
processed.
Identifiers: User
defined data item or
function names.
Operators: Things like +,
-, OR, AND etc.
Separators: ( ), { }, [ ] ; etc
Literals: User provided
strings or numbers etc.
Whitespaces: Tabs, space etc.
Directives: Special instructions
for compiler only.
Programming Terms
• Statements: The actions that a program takes are
expressed as Statements.
– Declaration and Assignment (int a=0;)
– Expression (area = 3.14*(radius*radius) )
– Selection or Iteration (if, switch, do, for etc.)
– Jump (goto, break, continue, return etc.)
• Expressions: A sequence of one or more operands
and zero or more operators that can be evaluated
to a single output.
– ((x<10)&&(x>5))||((x > 20)&&(x < 25))
– System.Convert.ToInt32("35")
Programming Paradigms
• Declarative: What computation should be
performed and not how to compute it. HTML, CSS,
SQL (Select Query)
• Imperative (requiring attention): That define
sequence of tasks to control flow of computational
algorithm.
– Non-Structured: Allows Jumping randomly by line numbers
or labels. E.g. Basic, Assembly, Cobol, Batch Files.
– Structured: Use only sequence, selection(condition) or
iteration(loop) methods to provide instructions. E.g. C, C#,
Java etc.
Structured Programming Models
• Procedural: Grouping of series of instructions as a
procedure (routine, function, subroutine, method,
module) that can be called from multiple places to
undertake the same task again.
• Object Oriented: Allows to define templates generally
called classes, similar to real life definitions that
encapsulates various properties and methods. For. E.g.
real life template “CAR” would mean properties like:
Colour, Body Style, Fuel Type and Methods like:
Driving( ), Changing Gears( ), Opening( ) Doors etc.
The physical interpretations like MARUTI-ALTO,
HONDA-CITY, HUNDAI-SANTRO, TATA-NANO are
understood as the objects of the class CAR. Thus the
name has been given as object oriented
programming or OOP.
Object Oriented Programming
• Class: A template definition of data items(properties)
and actions(Methods). For Example the Diagram of
CAR can be a real world metaphor to a class.
• Object: The physical item based on the class
definition is an object. For Example the real CAR
would be an Object. So one can say Objects are
instances of Class.
It is clear that one can have any number of instances
as the physical space permits.
OOPS - Inheritance
• Inheritance: One can observe that
even the template definitions have
more definitions of categories within a
template. For . E.g. Definition of a
“Car” can be the main template and
Definition of a “Small_Car” will be as
such a category with in “Car”.
It is clear that the definition of a
“Small_Car” will have all the definition
items included in the definition of a
“Car”. So we can say that class
“Small_Car” can be inherited from its
parent class “Car”. More properties
may follow in the definition of
“Small_Car”.
Class Car
Class Car
Class Small_Car
Class Big_Car
OOPS – Encapsulation & Abstraction
• Encapsulation: It is the way where actual methodology of achieving a result is hidden from
the external world users. For e.g. we can define a class CAR as follows.
Class CAR
{
property colour;
Method Steering(turn)
{
if turn is anticlockwise make the front wheel go left;
If turn is clockwise make the front wheel go right;
}
}
Here we see that method Steering( ) is actually hidden behind the class CAR and details of
the method are hidden to the external world and whenever the designer wants he can
change the design of achieving the goal of turning the steering handle. This is called
ENCAPSULATION.
• Abstraction: In above example we can see that user is only required to know about turning
the steering and he is not required to bother about internal system of turning a wheel. So
we can call the Method Steering is as such an ABSTRACT method and its purpose would be
distinctly different from any other method of the class CAR. The purpose we achieve out by
encapsulation is called ABSTRACTION.
OOPS: Polymorphism
• Polymorphism: Values of different data types to be handled using a uniform interface . For
e.g. if we assume PedalPush( ) to be method in the class CAR then this method can actually
be behaving in a polymorphic manner if the data parameter type are different, a Clutch, a
Brake or an Accelerator.
Class CAR
{
property WheelSize;
Method PedalPush(PedalTypeClutch)
{
Detach Engine Rotor from Wheel Rotation Rod;
}
Method PedalPush(PedalTypeBrake)
{
Initiate Brake Fluid to Brake Drum;
}
Method PedalPush(PedalTypeClutch, PedalTypeAccelerator)
{
Control Speed of the Car;
}
}
Overloading can be based on parameter type or number of parameters as is obvious from the
above example.
OOPS: Operator Overloading
• Operator Overloading: Providing polymorphic behaviour to
operators is called Operator Overloading. While overloading
an operator different functionality is provided on operands
based on the type of operands. Consider following case of
action of + (addition) operator.
1) 1 + 2 = 3
2) 2.1 + 0.02 = 2.02
3) [1, 2, 3] + [4, 5, 6] = [1, 2, 3, 4, 5, 6]
4) “Girl" + “friend" = “Girlfriend“
Here case 1 is integer addition, case 2 is floating point addition,
case 3 is list consolidation and case 4 is string concatenation. So
the code call has to be based on types of operand that are
added.
One can also see that operators are a special case
implementation of functions only. For e.g. x + y*z can be
written as add(x, multiply(y,z))
Architectural Models – Client Server
• A server application that is accessed directly by multiple clients. Also
known as 2 –tier model.
SERVER
(Like Webserver such as IIS)
ASP, ASP.NET etc run at the Server
end and the converted data as HTML,
Javascript is sent to the client. Main
application logic and database
access is done at the server.
CLIENT
(Like Browser)
HTML, DHTML and Javascript are
interpreted at the client
Architectural Models – 3 Tier
• The purpose of introducing an
additional layer is to separate
the business computation logic
or security logic from data
handling logic.
• Layers are often implemented
on physically separate
computer systems.
• This model is often extended to
more tiers called n-tier
architecture.
Middle Tier
(Contains the Presentation Layer
that serves the client interface and
the Business Logic Layer that
handles the computational process,
security may also be built-in here)
CLIENT
(Runs Converted Data from the
Presentation Layer)
Last Tier
(Usually Contains the Database
Interaction interface and the storage)
Bibliography
• http://en.wikipedia.org
• http://www.landofcode.com
• http://www.thescarms.com
• http://msdn.microsoft.com
• http://www.sum-it.nl/enoo.html
• Ask and guide me at
sunmitraeducation@gmail.com
• Share this information with as
many people as possible.
• Keep visiting www.sunmitra.com
for programme updates.

Weitere ähnliche Inhalte

Was ist angesagt?

Very Small Tutorial on Terrier 3.0 Retrieval Toolkit
Very Small Tutorial on Terrier 3.0 Retrieval ToolkitVery Small Tutorial on Terrier 3.0 Retrieval Toolkit
Very Small Tutorial on Terrier 3.0 Retrieval ToolkitKavita Ganesan
 
Programming in java basics
Programming in java  basicsProgramming in java  basics
Programming in java basicsLovelitJose
 
Project Lambda: To Multicore and Beyond
Project Lambda: To Multicore and BeyondProject Lambda: To Multicore and Beyond
Project Lambda: To Multicore and BeyondDmitry Buzdin
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programsKranthi Kumar
 
Operator Overloading and Scope of Variable
Operator Overloading and Scope of VariableOperator Overloading and Scope of Variable
Operator Overloading and Scope of VariableMOHIT DADU
 
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...jaxLondonConference
 
358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3sumitbardhan
 
implementing oop_concept
 implementing oop_concept implementing oop_concept
implementing oop_conceptAmit Gupta
 
Intro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part II
Intro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part IIIntro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part II
Intro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part IIBlue Elephant Consulting
 
java programming - applets
java programming - appletsjava programming - applets
java programming - appletsHarshithaAllu
 
Class notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsClass notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsKuntal Bhowmick
 

Was ist angesagt? (20)

Very Small Tutorial on Terrier 3.0 Retrieval Toolkit
Very Small Tutorial on Terrier 3.0 Retrieval ToolkitVery Small Tutorial on Terrier 3.0 Retrieval Toolkit
Very Small Tutorial on Terrier 3.0 Retrieval Toolkit
 
Programming in java basics
Programming in java  basicsProgramming in java  basics
Programming in java basics
 
Project Lambda: To Multicore and Beyond
Project Lambda: To Multicore and BeyondProject Lambda: To Multicore and Beyond
Project Lambda: To Multicore and Beyond
 
Ooabap notes with_programs
Ooabap notes with_programsOoabap notes with_programs
Ooabap notes with_programs
 
9 subprograms
9 subprograms9 subprograms
9 subprograms
 
Matlab brochure
Matlab  brochureMatlab  brochure
Matlab brochure
 
C progrmming
C progrmmingC progrmming
C progrmming
 
Java script
Java scriptJava script
Java script
 
Operator Overloading and Scope of Variable
Operator Overloading and Scope of VariableOperator Overloading and Scope of Variable
Operator Overloading and Scope of Variable
 
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
Project Lambda: Functional Programming Constructs in Java - Simon Ritter (Ora...
 
358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3
 
implementing oop_concept
 implementing oop_concept implementing oop_concept
implementing oop_concept
 
Intro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part II
Intro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part IIIntro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part II
Intro To C++ - Class 06 - Introduction To Classes, Objects, & Strings, Part II
 
Fundamentals of matlab programming
Fundamentals of matlab programmingFundamentals of matlab programming
Fundamentals of matlab programming
 
Unit 4 plsql
Unit 4  plsqlUnit 4  plsql
Unit 4 plsql
 
Chap1java5th
Chap1java5thChap1java5th
Chap1java5th
 
Chap2java5th
Chap2java5thChap2java5th
Chap2java5th
 
java programming - applets
java programming - appletsjava programming - applets
java programming - applets
 
Class notes(week 5) on command line arguments
Class notes(week 5) on command line argumentsClass notes(week 5) on command line arguments
Class notes(week 5) on command line arguments
 
X FILES
X FILESX FILES
X FILES
 

Ähnlich wie ProgrammingPrimerAndOOPS

Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)indiangarg
 
Patterns in Python
Patterns in PythonPatterns in Python
Patterns in Pythondn
 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1stConnex
 
Session 3 - Object oriented programming with Objective-C (part 1)
Session 3 - Object oriented programming with Objective-C (part 1)Session 3 - Object oriented programming with Objective-C (part 1)
Session 3 - Object oriented programming with Objective-C (part 1)Vu Tran Lam
 
Nose Dive into Apache Spark ML
Nose Dive into Apache Spark MLNose Dive into Apache Spark ML
Nose Dive into Apache Spark MLAhmet Bulut
 
Cs6301 programming and datastactures
Cs6301 programming and datastacturesCs6301 programming and datastactures
Cs6301 programming and datastacturesK.s. Ramesh
 
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scalaAutomate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scalaChetan Khatri
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)SANTOSH RATH
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profilerIhor Bobak
 
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...Chetan Khatri
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTnikshaikh786
 
Fundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxFundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxVigneshkumar Ponnusamy
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Uri Cohen
 

Ähnlich wie ProgrammingPrimerAndOOPS (20)

Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)Programming Fundamentals With OOPs Concepts (Java Examples Based)
Programming Fundamentals With OOPs Concepts (Java Examples Based)
 
c++ Unit I.pptx
c++ Unit I.pptxc++ Unit I.pptx
c++ Unit I.pptx
 
Patterns in Python
Patterns in PythonPatterns in Python
Patterns in Python
 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1st
 
Session 3 - Object oriented programming with Objective-C (part 1)
Session 3 - Object oriented programming with Objective-C (part 1)Session 3 - Object oriented programming with Objective-C (part 1)
Session 3 - Object oriented programming with Objective-C (part 1)
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Nose Dive into Apache Spark ML
Nose Dive into Apache Spark MLNose Dive into Apache Spark ML
Nose Dive into Apache Spark ML
 
Lecture 1 and 2
Lecture 1 and 2Lecture 1 and 2
Lecture 1 and 2
 
Cs6301 programming and datastactures
Cs6301 programming and datastacturesCs6301 programming and datastactures
Cs6301 programming and datastactures
 
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scalaAutomate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
Automate ml workflow_transmogrif_ai-_chetan_khatri_berlin-scala
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)
 
Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notes
 
c#.pptx
c#.pptxc#.pptx
c#.pptx
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
 
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
TransmogrifAI - Automate Machine Learning Workflow with the power of Scala an...
 
SE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPTSE-IT JAVA LAB OOP CONCEPT
SE-IT JAVA LAB OOP CONCEPT
 
Fundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxFundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptx
 
Unit 1
Unit  1Unit  1
Unit 1
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014
 
C programming
C programmingC programming
C programming
 

Mehr von sunmitraeducation

Mehr von sunmitraeducation (20)

Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Installing JDK and first java program
Installing JDK and first java programInstalling JDK and first java program
Installing JDK and first java program
 
Project1 VB
Project1 VBProject1 VB
Project1 VB
 
Project1 CS
Project1 CSProject1 CS
Project1 CS
 
Grid Vew Control VB
Grid Vew Control VBGrid Vew Control VB
Grid Vew Control VB
 
Grid View Control CS
Grid View Control CSGrid View Control CS
Grid View Control CS
 
Ms Access
Ms AccessMs Access
Ms Access
 
Database Basics Theory
Database Basics TheoryDatabase Basics Theory
Database Basics Theory
 
Visual Web Developer and Web Controls VB set 3
Visual Web Developer and Web Controls VB set 3Visual Web Developer and Web Controls VB set 3
Visual Web Developer and Web Controls VB set 3
 
Visual Web Developer and Web Controls CS set 3
Visual Web Developer and Web Controls CS set 3Visual Web Developer and Web Controls CS set 3
Visual Web Developer and Web Controls CS set 3
 
Progamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VBProgamming Primer Polymorphism (Method Overloading) VB
Progamming Primer Polymorphism (Method Overloading) VB
 
Programming Primer EncapsulationVB
Programming Primer EncapsulationVBProgramming Primer EncapsulationVB
Programming Primer EncapsulationVB
 
Programming Primer Encapsulation CS
Programming Primer Encapsulation CSProgramming Primer Encapsulation CS
Programming Primer Encapsulation CS
 
Programming Primer Inheritance VB
Programming Primer Inheritance VBProgramming Primer Inheritance VB
Programming Primer Inheritance VB
 
Programming Primer Inheritance CS
Programming Primer Inheritance CSProgramming Primer Inheritance CS
Programming Primer Inheritance CS
 
Web Server Controls VB Set 1
Web Server Controls VB Set 1Web Server Controls VB Set 1
Web Server Controls VB Set 1
 
Web Server Controls CS Set
Web Server Controls CS Set Web Server Controls CS Set
Web Server Controls CS Set
 
Web Controls Set-1
Web Controls Set-1Web Controls Set-1
Web Controls Set-1
 
Understanding IDEs
Understanding IDEsUnderstanding IDEs
Understanding IDEs
 
Html Server Image Control VB
Html Server Image Control VBHtml Server Image Control VB
Html Server Image Control VB
 

Kürzlich hochgeladen

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Kürzlich hochgeladen (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

ProgrammingPrimerAndOOPS

  • 1. PROGRAMMING PRIMER AND CONCEPTS OF OBJECT ORIENTED PROGRAMMING THEORY SESSION A Programme Under the Compumitra Education Series
  • 2. OUTLINE • Programming Concepts • Programming Logic • Program Running • Components of a Program • Programming Paradigms • Structured Programming • Object Oriented Programming. • Inheritance. • Encapsulation and Abstraction • Polymorphism and Overloading • Architectural model
  • 3. Programming Concepts • Programming: Predefined way of telling the computer that what task is to be performed. Also defined as sequence of instructions. • Computer Languages: Predefined system of Set of Instructions that a computer accepts. – High Level Programming Languages: Usually English Like Instruction set with a power to build application logic. Usually have an extremely strict syntax rules. e.g. C, Java, C++, C# etc. – Low Level Programming Languages: Set of Hardware related Mnemonics for direct control over processing and input/output functions. E.g. Assembly Language – Formatting and Interface Languages: Languages made primarily for the purpose of User side rendering of information. E.g. HTML, DHTML, XML Etc. – Data Query Languages: Languages to get and post to structured system of records called a database. SQL etc. – Data Definition Languages: Languages to define properties of Data or any type of content items. E.g. XML Schema (XSD), SQL-DDL (create table etc.)
  • 4. Programming Logic • Logic/Algorithm: Formulation Involved in performing a task. For e.g. – Fahrenheit to Celsius Conversion Formula. – Writing of Data in a file one character at a time or one block at a time. – Compression of image file to a smaller size file. – Method of following a protocol such as the HTTP protocol. Usually these words are interchangeably used but the word algorithm is more suitable for specific tasks now performed as a routine for e.g. image compression is more appropriately called algorithm while writing to a file may just be called a simple logic.
  • 5. Program Running • Interpretation: – Process of parsing the program instructions one by one so that it directly produces the desired output. – For e.g. Javascript is interpreted at the browser to run the given functionality. – Errors in the program code are caught at the time of running the program and are likely hinder application workflow. • Compilation: – Process of parsing the program instructions in one go and produce an intermediate file that can be directly run by the host system. – Errors are required to be removed before compilation is successfully completed. – Application workflow is usually not hindered as basic errors are removed initially. Only unexpected input conditions produce errors.
  • 6. Programming Instruction Purposes • The Primary Purposes of Programming Instructions are. – To take Input. – To give Output – To perform operations. – To run a program section based on a condition selection. – To repeat a section of code based on condition. Think that a computer is a generic machine that can emulate other machines based on the program it runs. INPUT OUTPUT OPERATE SELECTION REPETITION
  • 7. /* add.c simple C program */ #include <stdio.h> #define LAST 10 int main() { int i, sum = 0; for ( i = 1; i <= LAST; i++) { sum += i; } printf("sum = %dn", sum); return 0; } Programming Components (Tokens) Keywords: The instruction words used in a certain language. For eg. INT, IF, THEN, DO, NEXT, RETURN etc. Comments:Text not to be processed. Identifiers: User defined data item or function names. Operators: Things like +, -, OR, AND etc. Separators: ( ), { }, [ ] ; etc Literals: User provided strings or numbers etc. Whitespaces: Tabs, space etc. Directives: Special instructions for compiler only.
  • 8. Programming Terms • Statements: The actions that a program takes are expressed as Statements. – Declaration and Assignment (int a=0;) – Expression (area = 3.14*(radius*radius) ) – Selection or Iteration (if, switch, do, for etc.) – Jump (goto, break, continue, return etc.) • Expressions: A sequence of one or more operands and zero or more operators that can be evaluated to a single output. – ((x<10)&&(x>5))||((x > 20)&&(x < 25)) – System.Convert.ToInt32("35")
  • 9. Programming Paradigms • Declarative: What computation should be performed and not how to compute it. HTML, CSS, SQL (Select Query) • Imperative (requiring attention): That define sequence of tasks to control flow of computational algorithm. – Non-Structured: Allows Jumping randomly by line numbers or labels. E.g. Basic, Assembly, Cobol, Batch Files. – Structured: Use only sequence, selection(condition) or iteration(loop) methods to provide instructions. E.g. C, C#, Java etc.
  • 10. Structured Programming Models • Procedural: Grouping of series of instructions as a procedure (routine, function, subroutine, method, module) that can be called from multiple places to undertake the same task again. • Object Oriented: Allows to define templates generally called classes, similar to real life definitions that encapsulates various properties and methods. For. E.g. real life template “CAR” would mean properties like: Colour, Body Style, Fuel Type and Methods like: Driving( ), Changing Gears( ), Opening( ) Doors etc. The physical interpretations like MARUTI-ALTO, HONDA-CITY, HUNDAI-SANTRO, TATA-NANO are understood as the objects of the class CAR. Thus the name has been given as object oriented programming or OOP.
  • 11. Object Oriented Programming • Class: A template definition of data items(properties) and actions(Methods). For Example the Diagram of CAR can be a real world metaphor to a class. • Object: The physical item based on the class definition is an object. For Example the real CAR would be an Object. So one can say Objects are instances of Class. It is clear that one can have any number of instances as the physical space permits.
  • 12. OOPS - Inheritance • Inheritance: One can observe that even the template definitions have more definitions of categories within a template. For . E.g. Definition of a “Car” can be the main template and Definition of a “Small_Car” will be as such a category with in “Car”. It is clear that the definition of a “Small_Car” will have all the definition items included in the definition of a “Car”. So we can say that class “Small_Car” can be inherited from its parent class “Car”. More properties may follow in the definition of “Small_Car”. Class Car Class Car Class Small_Car Class Big_Car
  • 13. OOPS – Encapsulation & Abstraction • Encapsulation: It is the way where actual methodology of achieving a result is hidden from the external world users. For e.g. we can define a class CAR as follows. Class CAR { property colour; Method Steering(turn) { if turn is anticlockwise make the front wheel go left; If turn is clockwise make the front wheel go right; } } Here we see that method Steering( ) is actually hidden behind the class CAR and details of the method are hidden to the external world and whenever the designer wants he can change the design of achieving the goal of turning the steering handle. This is called ENCAPSULATION. • Abstraction: In above example we can see that user is only required to know about turning the steering and he is not required to bother about internal system of turning a wheel. So we can call the Method Steering is as such an ABSTRACT method and its purpose would be distinctly different from any other method of the class CAR. The purpose we achieve out by encapsulation is called ABSTRACTION.
  • 14. OOPS: Polymorphism • Polymorphism: Values of different data types to be handled using a uniform interface . For e.g. if we assume PedalPush( ) to be method in the class CAR then this method can actually be behaving in a polymorphic manner if the data parameter type are different, a Clutch, a Brake or an Accelerator. Class CAR { property WheelSize; Method PedalPush(PedalTypeClutch) { Detach Engine Rotor from Wheel Rotation Rod; } Method PedalPush(PedalTypeBrake) { Initiate Brake Fluid to Brake Drum; } Method PedalPush(PedalTypeClutch, PedalTypeAccelerator) { Control Speed of the Car; } } Overloading can be based on parameter type or number of parameters as is obvious from the above example.
  • 15. OOPS: Operator Overloading • Operator Overloading: Providing polymorphic behaviour to operators is called Operator Overloading. While overloading an operator different functionality is provided on operands based on the type of operands. Consider following case of action of + (addition) operator. 1) 1 + 2 = 3 2) 2.1 + 0.02 = 2.02 3) [1, 2, 3] + [4, 5, 6] = [1, 2, 3, 4, 5, 6] 4) “Girl" + “friend" = “Girlfriend“ Here case 1 is integer addition, case 2 is floating point addition, case 3 is list consolidation and case 4 is string concatenation. So the code call has to be based on types of operand that are added. One can also see that operators are a special case implementation of functions only. For e.g. x + y*z can be written as add(x, multiply(y,z))
  • 16. Architectural Models – Client Server • A server application that is accessed directly by multiple clients. Also known as 2 –tier model. SERVER (Like Webserver such as IIS) ASP, ASP.NET etc run at the Server end and the converted data as HTML, Javascript is sent to the client. Main application logic and database access is done at the server. CLIENT (Like Browser) HTML, DHTML and Javascript are interpreted at the client
  • 17. Architectural Models – 3 Tier • The purpose of introducing an additional layer is to separate the business computation logic or security logic from data handling logic. • Layers are often implemented on physically separate computer systems. • This model is often extended to more tiers called n-tier architecture. Middle Tier (Contains the Presentation Layer that serves the client interface and the Business Logic Layer that handles the computational process, security may also be built-in here) CLIENT (Runs Converted Data from the Presentation Layer) Last Tier (Usually Contains the Database Interaction interface and the storage)
  • 18. Bibliography • http://en.wikipedia.org • http://www.landofcode.com • http://www.thescarms.com • http://msdn.microsoft.com • http://www.sum-it.nl/enoo.html
  • 19. • Ask and guide me at sunmitraeducation@gmail.com • Share this information with as many people as possible. • Keep visiting www.sunmitra.com for programme updates.