Assignment_2_OOP
Assignment_2_OOP
- Define a base class 'Animal' with a method 'speak' that prints 'Animal makes a sound'.
- Create a derived class 'Dog' that inherits from 'Animal' and overrides 'speak' to print 'Woof!'.
- Create a class 'BankAccount' with private attributes for balance and methods to deposit and
withdraw money.
- Create multiple classes (e.g., Dog, Cat) that implement a common method 'speak' differently.
- Define a base class 'Animal' with a method 'speak' that prints 'Animal makes a sound'.
- Create a derived class 'Dog' that inherits from 'Animal' and overrides 'speak' to print 'Woof!'.
### Task 3: Multiple Inheritance
- Create a class 'BankAccount' with private attributes for balance and methods to deposit and
withdraw money.
- Create multiple classes (e.g., Dog, Cat) that implement a common method 'speak' differently.
- Define a base class 'Animal' with a method 'speak' that prints 'Animal makes a sound'.
- Create a derived class 'Dog' that inherits from 'Animal' and overrides 'speak' to print 'Woof!'.
- Create a class 'BankAccount' with private attributes for balance and methods to deposit and
withdraw money.
- Create multiple classes (e.g., Dog, Cat) that implement a common method 'speak' differently.
- Define a base class 'Animal' with a method 'speak' that prints 'Animal makes a sound'.
- Create a derived class 'Dog' that inherits from 'Animal' and overrides 'speak' to print 'Woof!'.
- Create a class 'BankAccount' with private attributes for balance and methods to deposit and
withdraw money.
- Create multiple classes (e.g., Dog, Cat) that implement a common method 'speak' differently.
- Define a base class 'Animal' with a method 'speak' that prints 'Animal makes a sound'.
- Create a derived class 'Dog' that inherits from 'Animal' and overrides 'speak' to print 'Woof!'.
- Create a class 'BankAccount' with private attributes for balance and methods to deposit and
withdraw money.
- Create multiple classes (e.g., Dog, Cat) that implement a common method 'speak' differently.