in python langauge Follow 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: o Create a file named inventory.py, where a Shoe class should be defined. o Create a class named Shoes with the following attributes: ● country, ● code, ● product, ● cost, and ● Quantity. o 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. o Outside this class create a variable with an empty list. This variable will be used to store a list of shoes objects o 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. o Now in your main create a menu that executes each function above. This menu should be inside the while loop. Be creative.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

in python langauge

Follow 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:
o Create a file named inventory.py, where a Shoe class should be
defined.
o Create a class named Shoes with the following attributes:
● country,
● code,
● product,
● cost, and
● Quantity.
o 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.
o Outside this class create a variable with an empty list. This variable
will be used to store a list of shoes objects
o 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.
o Now in your main create a menu that executes each function
above. This menu should be inside the while loop. Be creative.

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to Template
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY