PP II Write Up Points (Assignment 4 To 5)
PP II Write Up Points (Assignment 4 To 5)
Write a Python program to define a class called Product with attributes like product
name, price, quantity, and methods like add_stock, sell, and get_stock_value. Create
objects for different products and implement functionalities to add stock, sell
products (updating quantity), and calculate the total value of the inventory. Consider
including additional features like managing different categories and discounts.
Theory:
Algorithm:
Flowchart:
Input:
Output:
Infe
Assignment No: 5
Title / Problem Statement:
Write a Python program to define a base class called Food with attributes like name and
price. Create derived classes like Fruit, Vegetable and Dessert inheriting from Food. In each
derived class, implement a method called get_category() that returns the category of the
food (e.g., "Fruit", "Vegetable", or "Dessert"). Create objects of different food items and
call their get_category() methods to print their category.
Note - Use OOP feature Polymorphism
Course Outcome: CO115.2: Implement advanced OOP concepts and exception handling.
Theory:
a) Polymorphism:
b) Method overriding and overloading.
c) Operator overloading.
Algorithm:
Flowchart:
Input:
Output:
Inference: