0% found this document useful (0 votes)
5 views15 pages

Session I - OOPs Concepts

Uploaded by

temparonaldo7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views15 pages

Session I - OOPs Concepts

Uploaded by

temparonaldo7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

དཔལ་ལྡན་འབྲུག་གཞུང་། ཤེས་རིག་དང་རིག་རྩལ་གོང་

འཕེལ་ལྷན་ཁག།
Department of School Education
Ministry of Education & Skills Development

Online Training for ICT Teachers


Classes XI & XII ICT Curriculum

OOPs SESSION I

February 2023
Object Oriented Programming
(OOPs)
Content scope

Classes and objects


01 Attributes, Behaviour (methods),Identity (unique
name), Constructor and Encapsulation

Polymorphism
02 Method Overloading

Inheritance
03 Single level, Method overriding and Constructor
overriding
Competency

Develop applications using object-oriented concepts in a


programming language to break the program into bite-
sized problems for code efficiency and easy
maintenance.

01
Explain the features of Object Oriented Programming
Objectives

02
Explain the components of a class with examples

03 Apply object-oriented principles to create dynamic


applications.
Career Opportunities

Data Scientist Automation Game DeveloperSoftware


Engineer Developer
Principle of OOPs

Polymorphism Inheritance

Encapsulation Abstraction
Concept of Class, Attributes and Methods

0 Attributes Details of Dzong: Name, Location,


Class 01
01
1 Year built

02 Methods Behaviour of Dzong:


display_history()
Concept of Class, Attributes, Methods and Object

class Dzong:
0 Attributes name=”Punakha”
01
01
1

02 Methods def display_dzong():

Object 1t dzong1.Dzong()

Object 2t dzong2.Dzong()
Defining Class, Attributes, Methods

Class class Dzong:


name="Punakha Dzong" # Attributes
location="Punakha"
Attribut
year_built=1631
es

Method def display_history(self): # Methods


print(f"Name: {self.name}")
print(f"Location: {self.location}")
print(f"Year:{self.year_built}")
Constructor (Instance Variable)-Default
Sample
Code
class Dzong:
def __init__(self):
self.name="Punakha"
self.location="Bhutan"
self.year=1637
def display_history(self):
print(f"Name: {self.name}")
Output
print(f"Location: {self.location}")
print(f"Year: {self.year}")
dzong_1=Dzong()
dzong_1.display_history()

dzong_2=Dzong()
dzong_2.display_history()
Constructor (Instance Variable)-Parameterized
Sample
Code
class Dzong:
def__init__(self,name,location,built):
self.name=name
self.location=location
self.built=built
def display_history(self):
print(f"Name: {self.name}")
print(f"Location: {self.location}") Output
print(f"Year: {self.built}")

dzong=Dzong("Punakha","Bhutan",1637)
dzong.display_history()

dzong_1=Dzong("Tashichodzong","Bhutan",1629)
dzong_1.display_history()
Comparison(Default vs Parameterized)
Sample
Code
class Dzong: class Dzong:
def __init__(self): def__init__(self,name,location,built):
self.name="Punakha" self.name=name
self.location="Bhutan" self.location=location
self.year=1637 self.built=built
def display_history(self): def display_history(self):
print(f"Name: {self.name}") print(f"Name: {self.name}")
print(f"Location: {self.location}") print(f"Location: {self.location}")
print(f"Year: {self.year}") print(f"Year: {self.built}")
dzong_1=Dzong() dzong_1=Dzong("Punakha","Bhutan",1637)
dzong_1.display_history() dzong_1.display_history()

dzong_2=Dzong() dzong_2=Dzong("Tashichodzong","Bhutan",1629)
dzong_2.display_history() dzong_2.display_history()
Conclusion of constructor
Assignment

Activity 3: Task 3
Write a Python program to determine whether the student has passed or failed by
creating a class Student with attributes (name and marks)and relevant method(s).

Activity 3: Task 4:
Write a program to calculate the perimeter of a triangle by creating a class Triangle.
Days Program

Day Activity Title Concept

One Presentation on overview of Benefits of OOPs


(Monday) training program and OOPs Recap of python procedural programming.
concepts. Creating class and object
Activity 1: Comparing procedural Definition of attributes and methods.
and object-oriented programming
Activity 2: Creating a class and
object

Two Activity 3: Using constructor in a Concept of constructor.


(Tuesday) program Use of default and parameterized
constructor

Three Activity 4: Implementing Function overloading


(Wednesday) polymorphism Implementing inheritance
Activity 5: Implementing
inheritance

Four Activity 6: Creating dynamic Creating projects

You might also like