8000 GitHub - xyzoptooo/OOP_py
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

xyzoptooo/OOP_py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

OOP Assignments: The Boys Theme

This repository contains two Python assignments demonstrating object-oriented programming concepts such as inheritance, polymorphism, and encapsulation, themed around "the boys."

assignment1.py

  • Defines a Boy class with attributes and methods.
  • Defines a SingingBoy subclass that inherits from Boy and overrides a method to demonstrate polymorphism.
  • Demonstrates constructors to initialize objects with unique values.

assignment2.py

  • Defines a base Boy class with private attributes (encapsulation).
  • Defines SingingBoy and DancingBoy subclasses that inherit from Boy.
  • Each subclass overrides the action() method to demonstrate polymorphism.
  • Includes getter methods to access private attributes.

How to Run

Run them using Python 3:

python assignment1.py
python assignment2.py

Each script will print output demonstrating the respective OOP concepts.

Author

Created as a demonstration of OOP principles with a "boys" theme.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0