Lab 9
Lab 9
Question: 1
• Task: Create a geometric calculator that performs calculations on different geometric
shapes such as area and perimeter.
Question: 2
• Task: Create a system for managing menus in a restaurant with different categories like
appetizers, main courses, and desserts.
Question: 3
• Task: Develop a simulation program for an animal kingdom where different types of
animals exhibit various behaviors.
• Scenario: Implement polymorphism by designing a base class Animal with methods like
eat() and move(). Create subclasses such as Lion, Elephant, and Snake, each
overriding the eat() and move() methods to reflect the unique behavior of that animal
type.
Question: 4
• Task: Create a payroll system for a company that handles payments for different types of
employees including full-time, part-time, and contract workers.
Question: 5
• Task: Implement a system for managing bank accounts with different types such as
savings and checking accounts.
• Scenario: Create a base class Account with methods like withdraw() and deposit().
Subclass this base class to define specific account types like SavingsAccount and
CheckingAccount. Override the withdraw() method in each subclass to implement
specific withdrawal rules, such as minimum balance constraints for savings accounts
and overdraft protection for checking accounts.