SlideShare ist ein Scribd-Unternehmen logo
1 von 18
1--THE BENEFITS OF OOP.
Object Oriented Programming is a
method of implementation in which
programs are organised as co-operative
collection of objects each of which
represents an instance of some
classes and whose classes are all
members of hoerarchy of classes united
through the property
called inheritance.

OOP offers several benefits to the
program designer and the user. Object-
orientation
contributes to the solutions of many
problem associated with the
development and quality of
software products. The new technology
promises greater programmer
productivity, better quality
of software and lesser maintenance
cost. The principal advantages are:


1. Through inheritance, we can
eliminate redundant code and extend
the use of existing classes.
2. We can built programs from standard
working modules that communicate with
one another rather
than, having to start writing the code
from scratch. This leads to saving of
development time
and higher productivity.
3. The principle of data hiding helps
the programmers to built secure
program that can’t be
invaded by code in other parts of the
program.
4. It is possible to have multiple
objects to coexist without any
interference.
5. It is possible to map objects in
the problem domain to those objects in
the program.
6. It is easy to partition the work in
a project based on objects.
7. The data-centered design approach
enables us to capture more details of
the model in an
implementable form.
8. Object-oriented systems can be
easily upgraded from small to large
system
9. Message passing technique for
communication between objects make the
interface descriptions
with external system much simpler.
10. Software complexity can be easily
managed.
11. This language helps for software
development, which are more reliable.
12 .One should not use to check error
code after each potentially call.
13. Some of its application includes
design issues.
14. It is the enhanced form of C
language.
15. It is statically type language.
16. The most important Feature is that
it’s procedural and object oriented
nature.
17. As this is the more developed form
of c, it maintains the aspects if c
language yet it has
the feature of memory management.
18. C++ is much suitable for large
projects.
19. It is one of the fairly efficient
languages.
20. It divides the problems into
collection of objects which provides
services and can be used
to solve a particular problem.

21. Code re-use (Polymorphism,
Generics, Interfaces)
22. Code extensibility
23. Catch errors at compile time
rather than at runtime.
24. Reduces large problems to smaller,
more manageable ones.
25. Fits the way the real world works.
It is easy to map a real world problem
to a solution in
Object Oriented code.


2-- write a short note on class and
objects.

Object Oriented Programming is a
method of implementation in which
programs are
organised as co-operative collection
of objects each f which represents an
instance of some
classes and whose classes are all
members of hoerarchy of classes united
through the property
called inheritance.

A class is a user defined data-type
which is a collection of data member
and functions.

Class is created in oop to keep our
data secure which cannot be accessed
without
permission.The objects with data
structure(attributes) and
behaviour(operations) are grouped
into a class. All those objects
possessing similar properties are
grouped into the same unit.
it can solve real world problems. The
data members and member functions can
be private or
public in a class. There can be many
methods in a class which can be
accessed with its
permission to solve real world
problems. The data members of a class
is by default private. The
data members declared in a class in
accessed in a class only and it
cannot be accessed outside
the class. The member functions can
also be accessed with creating an
object which takes a
permission from class to access it as
per user requirement.

syntax of class is as under:

class(keyword) classname
{
data member
member functions or methods
};

For e.g: Create a class which ad 2
numbers.
#include<iostream>
using namespace std;
class add
{
int n1,n2;
public:
void setdata(int a,int b)
{
n1=a;
n2=b;
}
int add()
{
int sum;
sum=n1+n2;
return sum;
}
void display()
{
cout<<"Addition="<<add();
}
};
Objects is an entity that can store
data and send and receive messages. It
is an
instance of a class.

Objects are uniquely identifiable by a
name. There can be as many as objects
for a
class as per the requirement of users.
Each objects has its own properties.
Different entities
of a problem are examined
independently. These entities are
choosen because they have some
physical or conceptual boundaries that
separate them from rest of the
problem. The entities are
represented as objects in the program.
The goal is to have a clear
corresponding between
physical entities in the problme
domain and object in the program. an
object can be a person, a
place, a thing, etc.

syntax of object is as under:

}objectname;

or
int main()
{
classname objectname;
}


for e.g: create object to access above
methods of class add.

int main()
{
add a1;
a1.setdata(10,25);
a1.add();
a1,display();
return 0;
}


3--State difference between method
defined in the class and outside the
class.

Its differences are as follow:

The scope resolution operator is used
in method defined outside the class
where as, in
method define in the class no need to
use scope resolution operator. (::)

In method defined outside the class,
prototype or function header is to be
declared in
the class where as, in method defined
in the class method's body is also to
be mentioned with
its prototype.
The example of method within the class
is as under:

#include<iostream>
using namespace std;
class num
{
int n1,n2,n3;
public:
void setdata()
{
cout<<"enter numbers";
cin>>n1>>n2>>n3;
}
void display()
{
cout<<n1<<n2<<n3;
}
};

int main()
{
num n;
n.setdata();
n.display();
return 0;
}
The example of method outside the
class is as under:

#include<iostream>
using namespace std;
class num
{
int n1,n2,n3;
public:
void setdata()
void display()
};

void num::setdata()
{
cout<<"enter two numbers";
cin>>n1>>n2>>n3;
}
void num::display()
{
cout<<n1<<n2<<n3;
}

int main()
{
num n;
n.setdata();
n.display();
return 0;
}

Thus both differ from each others.

4-- Justify the following.

i} In class, member function cannot be
private.

In a class, class member functions can
be private but of no use, so always
its
preferable to keep member functions as
public so that a user can be able to
perform their
operations or claculations. A class is
used to secure our data and class
member functions
cannot be accessed without its object
and if they are private then of no use
beacuse they can't
be accessed with class objects also as
they are private so its necessary to
keep class member
functions as public access specifier.
A class member function should always
defined under
public specifier so that it can be
accessible as and when necessary.

for e.g.:

#include<iostream>
using namespace std;
class num
{
int n1,n2;
public:
void setdata(int a,int b)
{
   n1=a;
   n2=b;
}
void display()
{
cout<<n1<<n2;
}
};

int main()
{
num n;
n.setdata(10,15);
n.display();
return 0;
}

As above shown in example, a class
member functions should be always
under public
access specifier so that it can be
accessed as and when necessary.


ii}We can create object at a class
declaration time.

Its false, because a class object
cannot be declared at the time of
class declaration.
The syntax of class declaration is:
class(keyword) classname
{
member variable
member function
}

While the syntax of object declaration
is as follow:

An object can be declared in two ways
such as :
-At the end statement of class
}objectname

-In main :
int main()
{
classname objectname
}
So the object cannot be declared at
the class declaration time.

5--Short note on scope resolution
operator.

The scope resolution operator (::) in
c++ used to define the already
declared in the
member functions of the class.

C++ supports to the global variable
from a function,Local variable is to
defined in the
same function name.

The syntax of the scope resolution
operator:
:: globalvariablename
A scope resolution operator (::), can
be used to define the member functions
of a class
outside the class. It shows the scope
resolution operator untangling a mess
made by using the
same names for different kinds of
entities base class overridden member
function using the
scope resolution operator (::)The
scope resolution operator (denoted ::)
in C++ is used to
define the already declared member
functions of a particular class. In
the .cpp file one can
define the usual global functions or
the member functions of the class. To
differentiate
between the normal functions and the
member functions of the class, one
needs to use the scope
resolution operator (::) in between
the class name and the member function
name.

Its example is as follow:

#include<iostream>
using namespace std;
class num
{
int n1,n2,n3;
public:
void setdata()
void display()
};

void num::setdata()
{
cout<<"enter two numbers";
cin>>n1>>n2>>n3;
}
void num::display()
{
cout<<n1<<n2<<n3;
}
void num::mul()
{
   cout<<n1*n2*n3;
}

int main()
{
num n;
n.setdata();
n.display();
n.mul();
return 0;
}

Weitere Àhnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

01 c++ Intro.ppt
01 c++ Intro.ppt01 c++ Intro.ppt
01 c++ Intro.ppt
 
Inheritance
InheritanceInheritance
Inheritance
 
Function overloading ppt
Function overloading pptFunction overloading ppt
Function overloading ppt
 
Support for Object-Oriented Programming (OOP) in C++
Support for Object-Oriented Programming (OOP) in C++Support for Object-Oriented Programming (OOP) in C++
Support for Object-Oriented Programming (OOP) in C++
 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
 
Introduction to objective c
Introduction to objective cIntroduction to objective c
Introduction to objective c
 
Chapter 06 constructors and destructors
Chapter 06 constructors and destructorsChapter 06 constructors and destructors
Chapter 06 constructors and destructors
 
Chapter 2 c#
Chapter 2 c#Chapter 2 c#
Chapter 2 c#
 
Class and object
Class and objectClass and object
Class and object
 
Advanced Java Topics
Advanced Java TopicsAdvanced Java Topics
Advanced Java Topics
 
Object Oriented Programming With C++
Object Oriented Programming With C++Object Oriented Programming With C++
Object Oriented Programming With C++
 
C++ Interview Questions
C++ Interview QuestionsC++ Interview Questions
C++ Interview Questions
 
Class and object
Class and objectClass and object
Class and object
 
Oop l2
Oop l2Oop l2
Oop l2
 
C++ interview question
C++ interview questionC++ interview question
C++ interview question
 
C++ Object oriented concepts & programming
C++ Object oriented concepts & programmingC++ Object oriented concepts & programming
C++ Object oriented concepts & programming
 
Object Oriented Programming using C++ Part I
Object Oriented Programming using C++ Part IObject Oriented Programming using C++ Part I
Object Oriented Programming using C++ Part I
 
Programming in c++
Programming in c++Programming in c++
Programming in c++
 
Interoduction to c++
Interoduction to c++Interoduction to c++
Interoduction to c++
 
Qno 2 (a)
Qno 2 (a)Qno 2 (a)
Qno 2 (a)
 

Ähnlich wie I assignmnt(oops)

Object-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesObject-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesDurgesh Singh
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPTAjay Chimmani
 
My c++
My c++My c++
My c++snathick
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorialsakreyi
 
Application package
Application packageApplication package
Application packageJAYAARC
 
Introduction to C++ Programming
Introduction to C++ ProgrammingIntroduction to C++ Programming
Introduction to C++ ProgrammingPreeti Kashyap
 
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...yazad dumasia
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using ReflectionGanesh Samarthyam
 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1stConnex
 
Object Oriented Programming with C#
Object Oriented Programming with C#Object Oriented Programming with C#
Object Oriented Programming with C#SyedUmairAli9
 
C++ & VISUAL C++
C++ & VISUAL C++ C++ & VISUAL C++
C++ & VISUAL C++ Makaha Rutendo
 

Ähnlich wie I assignmnt(oops) (20)

Object-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modulesObject-oriented programming (OOP) with Complete understanding modules
Object-oriented programming (OOP) with Complete understanding modules
 
4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT4 pillars of OOPS CONCEPT
4 pillars of OOPS CONCEPT
 
The smartpath information systems c plus plus
The smartpath information systems  c plus plusThe smartpath information systems  c plus plus
The smartpath information systems c plus plus
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
 
My c++
My c++My c++
My c++
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
Mca 504 dotnet_unit3
Mca 504 dotnet_unit3Mca 504 dotnet_unit3
Mca 504 dotnet_unit3
 
Application package
Application packageApplication package
Application package
 
Php oop (1)
Php oop (1)Php oop (1)
Php oop (1)
 
Java sessionnotes
Java sessionnotesJava sessionnotes
Java sessionnotes
 
Introduction to C++ Programming
Introduction to C++ ProgrammingIntroduction to C++ Programming
Introduction to C++ Programming
 
Opp concept in c++
Opp concept in c++Opp concept in c++
Opp concept in c++
 
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Oopp Lab Work
Oopp Lab WorkOopp Lab Work
Oopp Lab Work
 
Oops ppt
Oops pptOops ppt
Oops ppt
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using Reflection
 
Presentation 1st
Presentation 1stPresentation 1st
Presentation 1st
 
Object Oriented Programming with C#
Object Oriented Programming with C#Object Oriented Programming with C#
Object Oriented Programming with C#
 
C++ & VISUAL C++
C++ & VISUAL C++ C++ & VISUAL C++
C++ & VISUAL C++
 

Mehr von Jay Patel

Unit 3(rdbms)
Unit 3(rdbms)Unit 3(rdbms)
Unit 3(rdbms)Jay Patel
 
Unit 3(rdbms)
Unit 3(rdbms)Unit 3(rdbms)
Unit 3(rdbms)Jay Patel
 
Assignment 2(web)
Assignment 2(web)Assignment 2(web)
Assignment 2(web)Jay Patel
 
Quiz(web)
Quiz(web)Quiz(web)
Quiz(web)Jay Patel
 
Assignment 2(web)
Assignment 2(web)Assignment 2(web)
Assignment 2(web)Jay Patel
 
Assignment 1(web)
Assignment 1(web)Assignment 1(web)
Assignment 1(web)Jay Patel
 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)Jay Patel
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)Jay Patel
 
Cursor
CursorCursor
CursorJay Patel
 
Anchored data type
Anchored data typeAnchored data type
Anchored data typeJay Patel
 
Selection sort
Selection sortSelection sort
Selection sortJay Patel
 
Mutlimedia authoring tools
Mutlimedia authoring toolsMutlimedia authoring tools
Mutlimedia authoring toolsJay Patel
 
Multimedia software tools
Multimedia software toolsMultimedia software tools
Multimedia software toolsJay Patel
 
Lecture6 text
Lecture6   textLecture6   text
Lecture6 textJay Patel
 
Lecture6 text
Lecture6   textLecture6   text
Lecture6 textJay Patel
 
Images
ImagesImages
ImagesJay Patel
 
Hypertext and hypermedia
Hypertext and hypermediaHypertext and hypermedia
Hypertext and hypermediaJay Patel
 
Multimedia software tools
Multimedia software toolsMultimedia software tools
Multimedia software toolsJay Patel
 

Mehr von Jay Patel (20)

Unit 3(rdbms)
Unit 3(rdbms)Unit 3(rdbms)
Unit 3(rdbms)
 
Unit 3(rdbms)
Unit 3(rdbms)Unit 3(rdbms)
Unit 3(rdbms)
 
Assignment 2(web)
Assignment 2(web)Assignment 2(web)
Assignment 2(web)
 
Quiz(web)
Quiz(web)Quiz(web)
Quiz(web)
 
Assignment 2(web)
Assignment 2(web)Assignment 2(web)
Assignment 2(web)
 
Assignment 1(web)
Assignment 1(web)Assignment 1(web)
Assignment 1(web)
 
Inline function(oops)
Inline function(oops)Inline function(oops)
Inline function(oops)
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
 
Unit1
Unit1Unit1
Unit1
 
Cursor
CursorCursor
Cursor
 
Anchored data type
Anchored data typeAnchored data type
Anchored data type
 
Selection sort
Selection sortSelection sort
Selection sort
 
Mutlimedia authoring tools
Mutlimedia authoring toolsMutlimedia authoring tools
Mutlimedia authoring tools
 
Multimedia software tools
Multimedia software toolsMultimedia software tools
Multimedia software tools
 
Lecture6 text
Lecture6   textLecture6   text
Lecture6 text
 
Sound
SoundSound
Sound
 
Lecture6 text
Lecture6   textLecture6   text
Lecture6 text
 
Images
ImagesImages
Images
 
Hypertext and hypermedia
Hypertext and hypermediaHypertext and hypermedia
Hypertext and hypermedia
 
Multimedia software tools
Multimedia software toolsMultimedia software tools
Multimedia software tools
 

KĂŒrzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
🐬 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
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĂșjo
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

KĂŒrzlich hochgeladen (20)

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

I assignmnt(oops)

  • 1. 1--THE BENEFITS OF OOP. Object Oriented Programming is a method of implementation in which programs are organised as co-operative collection of objects each of which represents an instance of some classes and whose classes are all members of hoerarchy of classes united through the property called inheritance. OOP offers several benefits to the program designer and the user. Object- orientation contributes to the solutions of many problem associated with the development and quality of software products. The new technology promises greater programmer productivity, better quality of software and lesser maintenance cost. The principal advantages are: 1. Through inheritance, we can eliminate redundant code and extend the use of existing classes.
  • 2. 2. We can built programs from standard working modules that communicate with one another rather than, having to start writing the code from scratch. This leads to saving of development time and higher productivity. 3. The principle of data hiding helps the programmers to built secure program that can’t be invaded by code in other parts of the program. 4. It is possible to have multiple objects to coexist without any interference. 5. It is possible to map objects in the problem domain to those objects in the program. 6. It is easy to partition the work in a project based on objects. 7. The data-centered design approach enables us to capture more details of the model in an implementable form. 8. Object-oriented systems can be easily upgraded from small to large system
  • 3. 9. Message passing technique for communication between objects make the interface descriptions with external system much simpler. 10. Software complexity can be easily managed. 11. This language helps for software development, which are more reliable. 12 .One should not use to check error code after each potentially call. 13. Some of its application includes design issues. 14. It is the enhanced form of C language. 15. It is statically type language. 16. The most important Feature is that it’s procedural and object oriented nature. 17. As this is the more developed form of c, it maintains the aspects if c language yet it has the feature of memory management. 18. C++ is much suitable for large projects. 19. It is one of the fairly efficient languages.
  • 4. 20. It divides the problems into collection of objects which provides services and can be used to solve a particular problem. 21. Code re-use (Polymorphism, Generics, Interfaces) 22. Code extensibility 23. Catch errors at compile time rather than at runtime. 24. Reduces large problems to smaller, more manageable ones. 25. Fits the way the real world works. It is easy to map a real world problem to a solution in Object Oriented code. 2-- write a short note on class and objects. Object Oriented Programming is a method of implementation in which programs are organised as co-operative collection of objects each f which represents an instance of some
  • 5. classes and whose classes are all members of hoerarchy of classes united through the property called inheritance. A class is a user defined data-type which is a collection of data member and functions. Class is created in oop to keep our data secure which cannot be accessed without permission.The objects with data structure(attributes) and behaviour(operations) are grouped into a class. All those objects possessing similar properties are grouped into the same unit. it can solve real world problems. The data members and member functions can be private or public in a class. There can be many methods in a class which can be accessed with its permission to solve real world problems. The data members of a class is by default private. The
  • 6. data members declared in a class in accessed in a class only and it cannot be accessed outside the class. The member functions can also be accessed with creating an object which takes a permission from class to access it as per user requirement. syntax of class is as under: class(keyword) classname { data member member functions or methods }; For e.g: Create a class which ad 2 numbers. #include<iostream> using namespace std; class add { int n1,n2; public: void setdata(int a,int b) { n1=a;
  • 7. n2=b; } int add() { int sum; sum=n1+n2; return sum; } void display() { cout<<"Addition="<<add(); } }; Objects is an entity that can store data and send and receive messages. It is an instance of a class. Objects are uniquely identifiable by a name. There can be as many as objects for a class as per the requirement of users. Each objects has its own properties. Different entities of a problem are examined independently. These entities are choosen because they have some
  • 8. physical or conceptual boundaries that separate them from rest of the problem. The entities are represented as objects in the program. The goal is to have a clear corresponding between physical entities in the problme domain and object in the program. an object can be a person, a place, a thing, etc. syntax of object is as under: }objectname; or int main() { classname objectname; } for e.g: create object to access above methods of class add. int main() { add a1;
  • 9. a1.setdata(10,25); a1.add(); a1,display(); return 0; } 3--State difference between method defined in the class and outside the class. Its differences are as follow: The scope resolution operator is used in method defined outside the class where as, in method define in the class no need to use scope resolution operator. (::) In method defined outside the class, prototype or function header is to be declared in the class where as, in method defined in the class method's body is also to be mentioned with its prototype.
  • 10. The example of method within the class is as under: #include<iostream> using namespace std; class num { int n1,n2,n3; public: void setdata() { cout<<"enter numbers"; cin>>n1>>n2>>n3; } void display() { cout<<n1<<n2<<n3; } }; int main() { num n; n.setdata(); n.display(); return 0; }
  • 11. The example of method outside the class is as under: #include<iostream> using namespace std; class num { int n1,n2,n3; public: void setdata() void display() }; void num::setdata() { cout<<"enter two numbers"; cin>>n1>>n2>>n3; } void num::display() { cout<<n1<<n2<<n3; } int main() { num n; n.setdata(); n.display();
  • 12. return 0; } Thus both differ from each others. 4-- Justify the following. i} In class, member function cannot be private. In a class, class member functions can be private but of no use, so always its preferable to keep member functions as public so that a user can be able to perform their operations or claculations. A class is used to secure our data and class member functions cannot be accessed without its object and if they are private then of no use beacuse they can't be accessed with class objects also as they are private so its necessary to keep class member functions as public access specifier. A class member function should always defined under
  • 13. public specifier so that it can be accessible as and when necessary. for e.g.: #include<iostream> using namespace std; class num { int n1,n2; public: void setdata(int a,int b) { n1=a; n2=b; } void display() { cout<<n1<<n2; } }; int main() { num n; n.setdata(10,15); n.display(); return 0;
  • 14. } As above shown in example, a class member functions should be always under public access specifier so that it can be accessed as and when necessary. ii}We can create object at a class declaration time. Its false, because a class object cannot be declared at the time of class declaration. The syntax of class declaration is: class(keyword) classname { member variable member function } While the syntax of object declaration is as follow: An object can be declared in two ways such as : -At the end statement of class
  • 15. }objectname -In main : int main() { classname objectname } So the object cannot be declared at the class declaration time. 5--Short note on scope resolution operator. The scope resolution operator (::) in c++ used to define the already declared in the member functions of the class. C++ supports to the global variable from a function,Local variable is to defined in the same function name. The syntax of the scope resolution operator: :: globalvariablename
  • 16. A scope resolution operator (::), can be used to define the member functions of a class outside the class. It shows the scope resolution operator untangling a mess made by using the same names for different kinds of entities base class overridden member function using the scope resolution operator (::)The scope resolution operator (denoted ::) in C++ is used to define the already declared member functions of a particular class. In the .cpp file one can define the usual global functions or the member functions of the class. To differentiate between the normal functions and the member functions of the class, one needs to use the scope resolution operator (::) in between the class name and the member function name. Its example is as follow: #include<iostream>
  • 17. using namespace std; class num { int n1,n2,n3; public: void setdata() void display() }; void num::setdata() { cout<<"enter two numbers"; cin>>n1>>n2>>n3; } void num::display() { cout<<n1<<n2<<n3; } void num::mul() { cout<<n1*n2*n3; } int main() { num n; n.setdata(); n.display();