Skip to main content

XI CS - DICTIONARY PROJECT - 22-11-24

 

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:

  1. Product No (key)
  2. Name
  3. Category
  4. Quantity
  5. Cost
  6. Amount: Calculated as Cost * Quantity.
  7. 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

Popular posts from this blog

CS - SORTING/SEARCHING ALGORITHMS

  SORTING ALGORITHMS                       SORTING ALGORITHM PDF LINK #Bubble Sort          ·        The outer loop iterates through the entire array. ·        The inner loop compares adjacent elements and swaps them if they are out of order. ·        The outer loop runs n times, and each pass moves the largest element to its correct position. arr=[3,8,5,2,1] n = len(arr) print(n) for i in range(n):  #traverse through all the elements         # Last i elements are already sorted, no need to check them         for j in range(0, n-i-1):              # Swap if the element found is greater than the next element              if arr[j] > arr[j+1]:               ...

GRADE XI - NESTED FOR LOOP

                                                         NESTED FOR LOOP 1. for var1 in range(3):      print(var1,"OUTER LOOP")          # 0 outer loop       1 outer loop      2 outer loop          for var2 in range(2):                  print(var2+1,"INNER LOOP")    #1  2 inner loop     1  2  inner loop   1 2 inner loop  2. Print the following pattern using for loop: 1  1 2  1 2 3  1 2 3 4  Sol: for r in range(1,5):   #ROWS     for c in range(1,r+1):   #COLUMNS         print(c,end=" ")     print() 3. Print the following pattern using for loop: @  @ @  @ @ @...