Project ICS 104 Term 232
Project ICS 104 Term 232
You will be given a list of items. This list tells what items and how many are available to the supplier.
In the example below, the names of 7 items, the number of available items, their purchase prices
per unit, their production dates (dd/mm/yy), and their validity period from the date of production (M
months).
Initialization:
Suppose you are a shopkeeper, who will buy these items and then you will set new selling prices for
your customers. The above information will be given to you in a text file named “supply.txt”. Each
line has 2 ‘#’ symbols. The first ‘#’ symbol separates the item ID from the item name and second ‘#’
symbol from other information separated by one or more blanks. Each line of the text-file contains a
unique item ID. Number of items is not fixed, items can be added or deleted.
Read the text file to find item(s) available to the supplier. Take all the items for your shop. After you
read, you must set a selling price (for your customers) for all the products. Keep in mind that the selling
price must be higher than the purchase price (from the supplier). To set the selling price, you will be
given a second text file containing the selling prices for all the 7 items. You will read the file named
“sell price.txt” and update your items selling price.
Page 1 of
7
When your program starts, it will do the above-mentioned initialization. Then it will display the menu shown
below:
Once the user chooses option 9, your program will save the modified data in the same file that was used for
reading at the beginning and with the same format. Note that the saving to a file will be done only for option
10. All the work before will be on the list (dictionary).
It displays complete information on all the items. It then waits for the Enter key to be pressed before
returning control to the main menu:
Item ID Item Name Items Current Selling Price Buying Price production date validity
Bought Stock
23001 Toothpaste 125ml 500 500 6.75 6.08 10/01/22 24
Note: Initially, the current stock value will be the same as the item bought from supplier. This will be updated
after you sell an item(s).
Page 2 of
7
Option 2: Display stock info for a particular item
It prompts for and reads the ItemID. It then searches for this ItemID in the list or dictionary. If the ItemID is
not found an appropriate error message is displayed, otherwise; the item information is displayed. In both
cases, the option waits for the Enter key to be pressed before returning control to the main menu.
Item ID Item Name Items Bought Current Stock Selling Price Buying Price production date validity
Note: Initially the profit earned for each item will be zero. Profit will come once you sell an item. The above
output is only for illustration.
Page 3 of
7
Option 4. Display profit earned by a particular item
It prompts for and reads an ItemID. If the ItemID is not found an appropriate error message is displayed
otherwise it shows the profit earned by that item only.
Control is returned to the main menu after pressing the Enter key.
Note: Initially the profit earned for each item will be zero. Profit will come once you sell an item. The above
output is only for illustration.
It prompts for and reads an ItemID, information to modify, and the new information. If the ItemID is not found
an appropriate error message is displayed, otherwise; the information is updated in the list and displays the
information before and after modification.
Before modification: 23001 Toothpaste 125ml 500 500 6.75 6.08 10/01/22 24
After modification: 23001 Toothpaste 125ml 500 175 7.25 6.25 10/08/22 24
Page 4 of
7
Option 6: Sell an item to customer
It prompts for and reads an ItemID, CustomerID, quantity and current date. If the ItemID is not found, an
appropriate error message is displayed; if the quantity is greater than the current stock, an appropriate error
message is displayed; if the items validity has been expired, an appropriate error message is displayed;
otherwise; the information is updated in the system and displays the information before and after sell of an
item. Note that, the CustomerID needs to be saved for retaining a customer's buying history (in option 7).
Before selling: 23004 Eggs Tray 200 200 22.5 20.25 15/07/23 1
After selling: 23004 Eggs Tray 200 150 22.5 20.25 15/07/23 1
This option will print a particular customer's buying history. The input is a CustomerID only. The output list will
all his previous buying records below. It should include Quantity of each item he bought, unit price of that item
and buying date of complete transaction.
Page 5 of
7
Option 8: Add a new item to current stock
It prompts for and read the ID of the item to be added. It will check if an item with same id already exists in
the items list. If not, it will be added by reading the remaining information i.e. name and other information.
Then it will display that item as shown in the sample below.
If the item ID already exists, an error message will be displayed.
Item ID Item Name Items Bought Current Stock Selling Price Buying Price Production data Validity
Item added:23008 Pen box 600 600 5.75 3.25 10/08/23 48
To implement option 8, search the ItemID in list or dictionary for the ItemID of the item to be deleted. If found,
delete it from the list/dictionary. If the ItemID does not exist, display an appropriate error message.
Page 6 of
7
The following items must be observed when you write your code:
Deliverables:
Lab demo/presentation:
• The period of Dec 19 - 23 will be used for lab project presentations (Tuesday, Lab time).
• A slot of 15 minutes will be allocated to each team for the presentation and questions.
• Students who do not appear for lab demo/presentation will get 0
Note:
• The project must be your own work.
• You must not share code with any other project group.
• Teams of 2 students will be formed. Choose your partner from your lab section 63.
• The project will be submitted on the blackboard. The deadline is indicated above.
• Cheating in any form will result in a grade of F in the course.
Page 1 of