Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

** Python program Using OOP to create a 'real-life' solution ** Hi there, Please can you help me with tweaking my code (Screenshots of code

** Python program Using OOP to create a 'real-life' solution **

Hi there, Please can you help me with tweaking my code (Screenshots of code provided)

as the functionality is not working. Thanking you in advance.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

image text in transcribed

CODE BELOW

(Kindly use the same code and let me know which Line numbers needs to be adjusted and how the adjusted code line should be written).

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Nike warehouses store the following information for each stock-taking list: - Country - Code - Product - Cost - Quantity - Value Other store managers (in other regions) would like to be able to use your program to do the following: - Search products by code. - Determine the product with the lowest quantity and restock it. - Determine the product with the highest quantity. - Calculate the value of each item entry, based on the quantity and cost of the item. The value is calculated by multiplying the cost by the quantity for each item entered. ow these steps: - Code a Python program that will read from the text file inventory.txt and perform the following on the data, to prepare for presentation to your managers: - Create a file named inventory.py, where a Shoe class should be defined. - Create a class named Shoes with the following attributes: - country, - code, - product, - cost, and - Quantity. - Inside this class define the following methods: - get_cost - which return the cost of the shoe - get_quanty - which return the quantity of the shoes - __-str__ - This method returns a string representation of a class. - Outside this class create a variable with an empty list. This variable will be used to store a list of shoes objects - Then you must define the following functions outside the class: - read_shoes_data - this function will open the file inventory.txt and read the data from this file the create shoes object and append this object into the shoes list. one line in this file represents data to create one object of shoes. You must use the try except in this function for error handling. - capture_shoes - this function will allow a user to capture data about a shoe and use this data to create a shoe object and append this object inside the shoe list. - view_all - this function will iterate over all the shoes list and print the details of the shoes that you return from the __str_ function. (Optional: You can organise you data in a table format by using Python's tabulate module ) - re_stock - this function will find the shoe object with the lowest quantity, which is the shoes that need to be restocked. Ask the user if he wants to add the quantity of these shoes and then update it. This quantity should be updated on the file for this shoe. - seach_shoe - This function will search for a shoe from the list using the shoe code and return this object so that it will be printed - value_per_item - this function will calculate the total value for each item. (Please keep the formula for value in mind; value =cost quantity). Print this information on the console for all the shoes. - highest_qty - Write code to determine the product with the highest quantity and print this shoe as being for sale. Now in your main create a menu that executes each function above. This menu should be inside the while loop. Be creative inventory.py L1T30 > inventory.txt

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions