LAB MANUAL 3 - Class
LAB MANUAL 3 - Class
SESSION: Fall-2024
SEMESTER: 2nd
OOP – Class | Object | Data Members |Member Functions |
Outlines
Lab - 1
Revised Programming Fundamentals
Lab – 2 (CLO-1 – Unerstand)
Class
Object
Data Members
Member Member Functions
Lab - 3(CLO-1 and 2 – Unerstand and identyfy)
Unified Modeling Language to Code
Class
Object
Data Members
Member Member Functions
Constructor
Defualt
Parametrize
OOP Introduction
OOP – Class | Object | Data Members |Member Functions |
Object
When a class is defined, only the specification for the object is defined; no memory or storage is
allocated.
To use the data and access functions defined in the class, we need to create objects.
Data Members
OOP – Class | Object | Data Members |Member Functions |
In C++, a data member is a variable declared within a class. It represents the state or attributes of
objects created from that class. Data members hold information that is specific to each instance of
the class.
Member Functions
In C++, a member function is a function that is declared as part of a class definition. Member
functions operate on objects of the class and have access to the class's data members (variables) and
other member functions. They encapsulate the behavior or actions that objects of the class can
perform.
+Member Functions
};
Class Name
{
Private:
string model;
string color;
double price;
int bulid year;
Public:
Member Functions
};
Task
OOP – Class | Object | Data Members |Member Functions |
Scenario 1:
Once upon a time, in a friendly neighborhood, there was a lively dog named Fido. Fido was always
cheerful and full of energy, eager to explore everything around him…………………………..
Scenraio 2:
Once upon a time, in the big sandy deserts, there was a special creature called the Camel. The Camel
OOP – Class | Object | Data Members |Member Functions |
was big and strong but also gentle and kind…………………………
Scenario 3:
Once upon a time, in a peaceful country side surrounded by hills and green fields, there was a gentle
cow named Daisy. Daisy wasn't like any other cow; she was famous for giving lots of milk and for her
OOP – Class | Object | Data Members |Member Functions |
sweet "moo" that echoed across the land………………………………………..
Scenraio 4:
OOP – Class | Object | Data Members |Member Functions |