Skip to content

Latest commit

ย 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—๏ธ Assignment 1 & Activity 2: Object-Oriented Programming in Python

This repository contains solutions for two programming activities focused on classes, inheritance, and polymorphism in Python.


Assignment 1: Design Your Own Class โ€” Smartphone

Overview

  • Created a Smartphone class with attributes like brand, model, storage, and color.
  • Added methods such as make_call() and take_photo() to simulate phone functionality.
  • Implemented inheritance with a subclass AndroidPhone that adds an Android version attribute and an install_app() method.
  • Demonstrated object creation and method usage.

Activity 2: Polymorphism Challenge โ€” Vehicles with move()

Overview

  • Defined a base class Vehicle with an abstract method move().
  • Created subclasses Car, Plane, and Boat that each implement move() differently.
  • Showcased polymorphism by iterating over a list of vehicles and calling their respective move() methods, producing distinct outputs.

How to Run

  1. Clone or download this repository.
  2. Open the Python files in your favorite editor or IDE.
  3. Run the scripts to see class behavior and polymorphism in action.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors