Question: System Specification & Problem Statement Your inventory program must support the following functions. Load the inventory from a file. This will overwrite in currently loaded

System Specification & Problem Statement Your inventory program must support the following functions.

Load the inventory from a file. This will overwrite in currently loaded inventory. Ask the user for the filename, if none is provided use inv.text

Save the current inventory to a file. Ask the user for the filename, if none is provided use inv.text.

Print the current inventory.

Update the count in the current inventory

. Add a new item to the current inventory.

Delete an item from the current inventory. Each item in the inventory is identified by a count and a product name. When inventory is stored in a file, each item will be in its own line as follows: 12 Printer 15 Laptop 10 LCD Screen 5 FHD LCD Screen

To get full credit, your program must be follow the following guidelines.

Products counts cannot be negative or non integers

Product names must be unique.

When reading from a file, if any line is not well formatted ignore it and print an appropriate message

. When reading a line from a file, ignore any leading or trailing whitespace.

Your program must never crash. Any errors or exceptions must be handled (e.g., using try/except group) or prevented from happening

Submitted Material For grading purposes, you need to submit your python file. A link on Moodle will be provided later for submitting the file. A template is provided for you to help you start with the project. However, you are free to change it or not used it at all.

# A simple program to manage inventory # # Authors: # - # - # class Inventory: pass def print_menu(): """Prints the program main menu including option numbers""" print("Choose one of the following options:") print(" 1. Load inventory from file") print(" 2. Save inventory to a file") print(" 3. Print inventory") print(" 4. Add new product") print(" 5. Update product count") print(" 6. Remove product") print(" 7. Quit") def load_from_file(file_name: str) -> Inventory: """Read inventory from a file and create a new Inventory object from it""" new_inv = Inventory() # # Complete this function # return new_inv # Initialize inventory my_inv = Inventory() # The main program loop while True: print_menu() # get the option from the user in_str = input("Enter an option number: ") if in_str == "7": # Quit the program quit() elif in_str == "1": input_file_str = input("Enter file name: ") my_inv = load_from_file(input_file_str) elif in_str == "2": pass elif in_str == "3": pass elif in_str == "4": pass elif in_str == "5": pass elif in_str == "6": pass else: # Not a valid option print("Invalid. Please, enter a valid option.") 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!