Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Introduction to Object Oriented Programming
1.
2. I am a person
I have a name which is Kulari
I have a surname Lokuge
I have a Birthday
I have a height
I work at a University in Melbourne
I drive to work about 15 km
I write research papers
I supervise projects
I play the piano
I walk with my dog everyday
3. Name: Mike, Chalin, Mike, Salime, Irine, Isesak Water Victoria,
Jakson, William, Mosses, John, Salina, Mosses, Nasa, Mervin, Gitida,
Habats, Rita, John, Sarah, Jim, Joseph, Roset, Hamet, Rasberis,
Geroge
University year:
Age:
Height:
What are you good at?
Playing sports?
Cooking?
Reading?
Writing?
4. Name: Name:
Age: Age:
Height: Height:
Activities: Activities:
Talk Talk
Read Read
Write Write
Walk Walk
5.
6. Person
Kulari
Name:
Age: Sam
Height:
Peter
Activities:
Talk
Read
Write
Walk
7. // smallobj.cpp
// demonstrates a small, simple object
#include <iostream>
using namespace std; ////////////////////////////////////////////////////
class smallobj //declare a class
{
?
?
private:
int somedata; //class data
public:
void setdata(int d) //member function to set data
{ somedata = d; }
void showdata() //member function to display data
{ cout << "Data is " << somedata << endl; }
};
////////////////////////////////////////////////////////////////
int main()
{
smallobj s1, s2; //define two objects of class smallobj
s1.setdata(1066); //call member function to set data
s2.setdata(1776); s1.showdata(); //call member function to display data
8. Private – generally data is hidden within the class so that it
will be safe from accidental manipulations
Public - generally functions are public so that they can be
accessed from outside the class
Is this a Rule? No
The data can be public and some functions can be private
9. Person
Lecturer Student Admin
Senior Junior Final First
10. Object-oriented languages like C++ enable
you to create your own data types.
Why is it important?
New user defined data types make
programs
› easier to visualize and implement from designs.
› reusable.
› easy to modify and enhance new data types as
programs evolve and specifications change.
› New data types let you create objects with
simple declarations.
11. An object is an instantiation of a data
type.
Examples.
› Person p;
› Window w;
› Window object Database ood;
http://www.cs.bu.edu/teaching/cpp/polymorphism/intro/ Navigating C++ and Object-Oriented Design The Waite Group's Object-Oriented Programming in C++ by Robert Lafore