Product Inventory Example
This example shows a full run of the program, including all the options and features.
$ python3 inventory.py
--CS 21 Inventory Management System--
1) Load product inventory from file.
2) Display individual product details.
3) Display all product details.
4) Add product to inventory.
5) Build invoice.
0) Quit.
What would you like to do? 3
All products currently in the inventory:
1 | Paper (Pack of 500 Sheets) | $ 5.80
2 | Scissors | $ 2.25
3 | Pen (Pack of 12) | $ 4.32
4 | Sticky notes | $ 3.00
5 | Bottled Water (Pack of 10) | $ 39.65
6 | Stapler | $ 2.89
--CS 21 Inventory Management System--
1) Load product inventory from file.
2) Display individual product details.
3) Display all product details.
4) Add product to inventory.
5) Build invoice.
0) Quit.
What would you like to do? 2
Which product ID? 1
1 | Paper (Pack of 500 Sheets) | $ 5.80
--CS 21 Inventory Management System--
1) Load product inventory from file.
2) Display individual product details.
3) Display all product details.
4) Add product to inventory.
5) Build invoice.
0) Quit.
What would you like to do? 2
Which product ID? 15
No matching product found.
--CS 21 Inventory Management System--
1) Load product inventory from file.
2) Display individual product details.
3) Display all product details.
4) Add product to inventory.
5) Build invoice.
0) Quit.
What would you like to do? 4
Product ID: 5
Sorry, product ID 5 is already in use.
Product ID: 10
Product description: Candy Bar
Product price: 1.50
--CS 21 Inventory Management System--
1) Load product inventory from file.
2) Display individual product details.
3) Display all product details.
4) Add product to inventory.
5) Build invoice.
0) Quit.
What would you like to do? 3
All products currently in the inventory:
1 | Paper (Pack of 500 Sheets) | $ 5.80
2 | Scissors | $ 2.25
3 | Pen (Pack of 12) | $ 4.32
4 | Sticky notes | $ 3.00
5 | Bottled Water (Pack of 10) | $ 39.65
6 | Stapler | $ 2.89
10 | Candy Bar | $ 1.50
--CS 21 Inventory Management System--
1) Load product inventory from file.
2) Display individual product details.
3) Display all product details.
4) Add product to inventory.
5) Build invoice.
0) Quit.
What would you like to do? 5
How many products? 4
Product #1 ID? 10
Quantity? 5
Product #2 ID? 15
No matching product found.
Product #2 ID? 1
Quantity? 3
Product #3 ID? 2
Quantity? -10
Please enter an integer larger than 1.
Quantity? 0
Please enter an integer larger than 1.
Quantity? 12
Product #4 ID? 10
Quantity? 500
Final invoice:
10 | Candy Bar | $ 1.50 x5
1 | Paper (Pack of 500 Sheets) | $ 5.80 x3
2 | Scissors | $ 2.25 x12
10 | Candy Bar | $ 1.50 x500
Total: 801.90
--CS 21 Inventory Management System--
1) Load product inventory from file.
2) Display individual product details.
3) Display all product details.
4) Add product to inventory.
5) Build invoice.
0) Quit.
What would you like to do? 0
Bye!