Welcome to CS 333 - Testing and DevOps! Your first assignment is outlined below:
The goals of this project are to:
- review basic object oriented principles
- allow students to explore using the Python programming language
Use Vehicles to explore applying object oriented principles in Python.
- Use a main method to instantiate each class and call functions.
- Each class definition should be in a separate file.
- .py files for each class and the main driver which include each principles as described below
- a text document with you and your partner's reflections on polymorphism and Python
- Implement a simple Car class and a Bicycle class.
- Include constructors and useful properties (like
color
orname
) for each class. - Consider useful methods (like
start()
orpedal()
) for each class.
- Include constructors and useful properties (like
- Both classes should inherit from a Vehicle class.
- Outside of C++, polymorphism generally refers to runtime polymorphism
- we would demonstrate that by creating a Vehicle object and assigning a Car to it, calling a function, then assigning a Bicycle object to it and calling the function again.
- If you did that in Python, would it be Polymorphism?
- Why or why not?
- Often classes are composed with other classes, for example, a Car and Bike both have Wheels or a Car has an Engine.
- Create classes for each entity and use composition to add them to your Car or Bicycle class (you may use the same Wheel class for Cars and Bikes)