PPT Lecture 1.2.1
PPT Lecture 1.2.1
Course Objectives
3
Scheme of Evaluation
Direct Evaluation Weightage of actual Final Weightage in Mapping with SIs Remarks
Sl No. Frequency of Task BT Levels CO Mapping Mapping with PIs
Instruments conduct Internal Assessment (ABET) (Graded/Non-Graded)
SO1 1a,1b,1c
10 marks for each
1 Assignment One per unit 10 Hard CO4,CO5 Graded
assignment
SO6
2 Exam 20 marks for one MST 2 per semester 20 Medium CO1,CO2,CO3,CO4 6a,6b Graded
3 Case Study 8 marks 1 per unit 8 Easy CO2 SO1, SO6 1c,6b Graded
NA NA NA NA
One per lecture
4 Homework NA topic (of 2 NA Non-Graded
questions)
NA NA NA NA
5 Discussion Forum NA One per unit NA Non-Graded
NA NA NA NA
6 Presentation NA NA NA Non-Graded
7 Attendance NA NA 2 NA NA NA NA Graded
Remarks
Direct Evaluation Final Weightage in Mapping with SIs
S No. Weightage of actual conduct Frequency of Task BT Levels CO Mapping Mapping with PIs (Graded/Non-
Instruments Internal Assessment (ABET)
Graded)
Unit wise Practical 1a, 1b, 1c, 6a, 6b SO1, SO6
1 15 marks 3 45 Medium 1,2,3,4,5 Graded
Evaluation
1a, 1b, 1c, 6a, 6b
2 Exam 15 marks for one MST 1 per semester 15 Medium 1,2,3 SO1, SO6 Graded
3 Attendance NA NA 2 NA NA NA NA Graded
4
What
. A class is user defined
data type defined in C+
+ using Why
keyword class followed by A class in C++ is the building
the name of class. The block, that leads to Object-
body of class is defined Oriented programming. It is a
inside the curly brackets user-defined data type, which
and terminated by a holds its own data members and
semicolon at the end. member functions, which can be
accessed and used by creating an
instance of that class.
CONTENTS
• Specifying a class
• Creating Objects
• Accessing the class members
6
Class
• A class is user defined data type which consists of two sections, a private and a
protected section that holds data and a public section that holds the interface
operations.
• A class definition is a process of naming a class and data variables, and methods
or interface operations of the class.
• Once a class has been defined, we can create any number of objects belonging to
that class.
• A class is collection of objects of similar type.
8
Objects
9
Creating Objects
• Objects are created from classes. Class objects are declared in a similar way as
variables are declared. The class name must start, followed by the object name.
For example,
ABC ob1,ob2; //object declaration will create two objects ob1 and
ob2 of ABC class type.
• Memory space is allocated separately to each object for their data members.
• Member variables store different values for different objects of a class.
10
Accessing Class Members
11
Accessing Class Members
Following is an example to show you how to initialize and use the public data members
using the dot (.) operator and the respective object of class.
class Student
{
public:
int rollno;
string name;
};
int main()
{
13
Accessing Public Class Members
Student A;
Student B;
// setting values for A object
A.rollno=2021;
A.name="Karan";
// setting values for B object
B.rollno=20212121;
B.name="Arjun";
cout <<"Name and Roll no of A is: "<< A.name << "-" << A.rollno;
cout <<"Name and Roll no of B is: "<< B.name << "-" << B.rollno;
}
14
OUTPUT:
15
Summary
16
Frequently Asked question
Q1What is a class?
A class is user defined data type which consists of two sections, a private and a
protected section that holds data and a public section that holds the interface
operations. A class definition is a process of naming a class and data variables, and
methods or interface operations of the class. A class is defined in C++ using
keyword class followed by the name of class. The body of class is defined inside the curly
brackets and terminated by a semicolon at the end.
Q2 What is an object?
An Object is an instance of a Class. When a class is defined, no memory is allocated but
when it is instantiated (i.e. an object is created) memory is allocated. For example: in real
life, a car is an object.
17
Q3 How to create an object?
Objects are created from classes. Class objects are declared in a
similar way as variables are declared. The class name must start,
followed by the object name.
class name object name;
18
Assessment Questions:
1. Where does the object is created?
A. Class
B. Constructor
C. Destructors
D. Attributes
2.A member function can always access the data in __________ , (in C++).
(A) the class of which it is member
(B) the object of which it is a member
(C) the public part of its class
(D) the private part of its class
19
Discussion forum.
How to create Class and Objects CPP?
How to access class members?
https://youtu.be/6Q0Cff29YwU
https://youtu.be/n9Ej2J0m4a0
20
REFERENCES
Reference Books:
Websites:
• https://www.tutorialspoint.com/cplusplus/cpp_classes_objects.htm
• https://www.w3schools.com/cpp/cpp_classes.asp
YouTube Links:
• https://youtu.be/6Q0Cff29YwU
• https://youtu.be/n9Ej2J0m4a0
21
THANK YOU