DICTIONARY PROJECT
Task: Create a Python program
to manage a dictionary named Product with the following structure:
Each entry in the dictionary should represent a product and include the
following attributes:
- Product
No (key)
- Name
- Category
- Quantity
- Cost
- Amount:
Calculated as Cost * Quantity.
- Package
Cost: Calculated based on the Category:
- Cosmetic:
8% of the cost.
- Electronic:
6% of the cost.
- Grocery:
5% of the cost.
- Other:
Fixed cost of 300.
Requirements: Write a
menu-driven program to perform the following operations:
a. Count all products belonging to a particular category (user-specified).
b. Display the Product No, Name, and Amount for all products whose Amount
exceeds 10,000.
c. Calculate and display the average Amount for a user-specified category.
d. Search for and display details of a product based on its Product No.
Comments
Post a Comment