Reservation
Reservation
2. Encapsulation
3. Inheritance
Create a parent class Animal with attributes name and species and a method speak().
Create two child classes Dog and Cat. Override the speak() method for each subclass
with appropriate sounds.
Test the functionality by creating objects of both subclasses.
4. Polymorphism
Create a function describe(animal) that takes an object of type Animal and calls its
speak() method.
Pass instances of Dog and Cat (from the previous exercise) to describe() and observe
how polymorphism works.
5. Abstraction
6. Composition
Create a class Engine with attributes horsepower and type.
Create a class Car that has an Engine object as an attribute.
Write methods to display details of the car and its engine.
8. Real-World Simulation
logic
1. Number Manipulation
2. Sorting Algorithms
4. String Problems
5. Searching Algorithms
6. Logical Puzzles
7. Matrix Operations
9. Dynamic Programming
markdown
CopierModifier
* 1 A
** 12 AB
*** 123 ABC
**** 1234 ABCD
Write a program to solve the Traveling Salesman Problem (brute force for small inputs).
Optimize it using heuristic methods if possible.