Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 2.28 KB

prob.md

File metadata and controls

34 lines (24 loc) · 2.28 KB

Problem

By Fandika Ikhsan


Here is a problem set to test your understanding of Object-Oriented Programming (OOP) concepts:

  1. Classes and Objects: Learn how to define classes and create objects. Problem: Create a class to represent a car and its properties (such as make, model, year, etc.). Create several car objects and display their properties.

  2. Inheritance: Learn how to create a class that inherits from another class. Problem: Create a class to represent a sports car that inherits from the car class, and add a new property (such as top speed) to it. Create several sports car objects and display their properties.

  3. Polymorphism: Learn how to create methods that have the same name but different implementations in different classes. Problem: Create a class to represent a truck that inherits from the car class, and add a new method (such as carrying capacity) to it. Create several truck objects and display their properties and methods.

  4. Encapsulation: Learn how to hide the implementation details of a class and expose only the necessary information. Problem: Create a class to represent a bank account and its properties (such as balance, interest rate, etc.). Add methods to deposit and withdraw money from the account, and hide the implementation details of the methods.

  5. Abstract Classes and Interfaces: Learn how to create abstract classes and interfaces, and implement them in concrete classes. Problem: Create an abstract class to represent a vehicle and its properties (such as make, model, year, etc.). Create several concrete classes that inherit from the vehicle class (such as car, truck, and sports car), and implement an interface to represent the capabilities of the vehicle (such as speed, carrying capacity, etc.).


Final Project:

Put your skills to the test by creating a final project that showcases what you have learned in this problem set.

Problem: Create a complete simulation of a car dealership that uses classes, inheritance, polymorphism, encapsulation, and abstract classes/interfaces. The simulation should allow the user to view the inventory of cars, trucks, and sports cars, and make purchases or trade-ins. This problem set will help you understand the core concepts of OOP and apply them in real-world scenarios. Good luck!