0% found this document useful (0 votes)
30 views7 pages

Project ICS 104 Term 232

This document describes a business stock system project. It outlines 10 options for a menu including viewing stock information, profits, modifying data, selling items, and adding or deleting items. It provides examples of expected outputs for each menu option.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views7 pages

Project ICS 104 Term 232

This document describes a business stock system project. It outlines 10 options for a menu including viewing stock information, profits, modifying data, selling items, and adding or deleting items. It provides examples of expected outputs for each menu option.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

ICS 104 Lab Project (Term 232)

Business Stock System

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).

23001# Toothpaste 125ml# 500 6.08 10/01/22 24


23002# Soap 120gm# 800 300 3.75 21/06/22 24
23003# Shampoo 400ml# 350 15.55 01/01/21 24
23004# Eggs Tray# 200 50 20.25 15/07/23 1
23005# Apples 1kg# 60 27 4.73 13/01/23 1
23006# Milk 1liter# 50 25 5.63 01/11/23 2
23007# Yogurt 1kg# 50 28 6.3 01/03/23 2

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:

1. Display complete stock info for all items


2. Display stock info for a particular item
3. Display profit earned by all items
4. Display profit earned by a particular item
5. Modify a particular item information
6. Sell an item to customer
7. Print a customer’s buying history
8. Add a new item
9. Delete an item
10. Save and Exit

Please select your choice:


Your program must loop as long as option 10 has not been selected. It must display an appropriate error
message if an invalid choice is entered. Each of the options must be implemented in a separate function.

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).

The options must have the following behaviors:

Option 1: Display complete stock information for all items

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:

Please select your choice: 1

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

23002 Soap 120gm 800 800 4.50 3.75 21/06/22 24

23003 Shampoo 400ml 350 350 16.70 15.55 01/01/21 24

23004 Eggs Tray 200 200 22.50 20.25 15/07/23 1

23005 Apples 1kg 60 60 5.25 4.73 13/01/23 1

23006 Milk 1liter 50 50 6.30 5.63 01/11/23 2

23007 Yogurt 1kg 50 50 7.00 6.30 01/03/23 2

Press Enter key to continue . . .

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.

Please select your choice: 2


Enter ItemID: 23002

Item ID Item Name Items Bought Current Stock Selling Price Buying Price production date validity

23002 Soap 120gm 800 800 4.50 3.75 21/06/22 24

Press Enter key to continue . . .


Please select your choice: 2
Enter ItemID: 23102

Error: Invalid item ID


Press Enter key to continue . . .

Option 3: Display profit earned by all items

This option displays the profit earned by all items.


Profit = Number of items sold X (Difference between the buying & selling prices).
Control is then returned to the main menu after pressing the Enter key.

Please select your choice: 3

Item ID Item Name Profit Earned

23001 Toothpaste 125ml 217.75


23002 Soap 120gm 375.00
23003 Shampoo 400ml 110.40
23004 Eggs Tray 337.50
23005 Apples 1kg 17.16
23006 Milk 1liter 16.75
23007 Yogurt 1kg 15.40

Total Profit: 1089.96 SR

Press Enter key to continue . . .

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.

Please select your choice: 4


Enter ItemID: 23005

Item ID Item Name Profit Earned


23005 Apples 1kg 17.16

Press Enter key to continue . . .


Please select your choice: 4
Enter ItemID: 20305

Error: Invalid item ID


Press Enter key to continue . . .

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.

Option 5: Modify a particular item information

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.

Please select your choice: 5


Please enter ItemID: 23001
Please enter new information: 500 175 7.25 6.25 10/08/22 24

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

Press Enter key to continue . . .


Please select your choice: 5
Enter ItemID: 20311

Error: Invalid item ID


Press Enter key to continue . . .

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).

Please select your choice: 6


Please enter ItemID: 23004
Please enter CustomerID, quantity, date (separated by space): C001 50 20/07/23

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

Press Enter key to continue . . .


Please select your choice: 6
Please enter ItemID: 23009

Error: Invalid item ID


Press Enter key to continue . . .
Please select your choice: 6
Please enter ItemID: 23004
Please enter quantity, date (separated by space): C001 50 18/08/20

Error: The item has been expired


Press Enter key to continue . . .

Option 7: Print a customer's buying history

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.

Please select your choice: 7


Please enter CustomerID: C001

Eggs Tray 50 22.5 20/07/23

Please select your choice: 7


Please enter CustomerID: C002

Error: Invalid Customer ID


Press Enter key to continue . . .

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.

Please select your choice: 8


Please enter ItemID: 23008
Please enter new information: Pen box 600 600 5.75 3.25 10/08/23 48

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

Press Enter key to continue . . .


Please select your choice: 8
Enter ItemID: 23007

Error: Item ID already used


Press Enter key to continue . . .

Option 9: Delete an item

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.

Please select your choice: 9


Enter ItemID: 23005

Item: 23005 deleted successfully

Press Enter key to continue . . .

Please select your choice: 9


Enter ItemID: 23125

Error: Invalid item ID


Press Enter key to continue . . .

Option 10: Save and Exit


Save all data to a new file named “Current Stock.txt”, then terminate the program.

Page 6 of
7
The following items must be observed when you write your code:

• Comments are important, they are worth. (worth 5%)


• The code must use meaningful variable names and modular programming (worth 10%)
• Global variables are not allowed. You should learn how to pass parameters to functions
and receive results.
• You must submit a working program. Non-working parts can be submitted separately. If
a team submits a non-working program, it loses 20% of the grade.
• User input must be validated by the program i.e. valid range and valid type
• Your code has to be limited to the material covered in the lectures and Lab.
• The deadline for submitting the lab project including report is Thursday May 16 before
midnight.
• Submitting Friday before midnight will lead to 5% penalty.
• Submitting Saturday before midnight 15% penalty.

Deliverables:

Each team must submit:

• The code as a Jupyter notebook


• The report as part of the Jupyter notebook or as a separate word file. The report will
describe how you solved the problem. In addition, you need to describe the different
functions with their task and screen shots of your running code. (worth 5%)

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

You might also like