PLEASE PLEASE PLEASE
DO NOT COPY FROM PREVIOUS ANSWER
Please provide correct answer i have 0 question left so if the answer is wrong i will DOWNVOTE and report u r account There are no more options i have
Hoping for help figuring out a Python assignment Your work on the last project, the inventory ordering system, was so well received that your boss has asked you to write a new program for the firm. She mentions that she's heard a lot about "Object Oriented Programming" and wants you to create a database of part's suppliers that the company will use to source new inventory from. She mentions that there have been a lot of new entrants into the market and its important that you source the new widgets and sprockets at the best cost possible! From speaking with her you realize that youll need three new class definitions - a class that models a supplier, a class that represents a part, and class that will contain information about all these suppliers. The parts class will need to contain the following information: 1. Part name 2. Part cost The parts class will need to contain the following methods: 1. An init method that lets the user set the name and cost of the part The supplier class will need to contain the following information: 1. The company name 2A list of the parts the company supplies The supplier class will need the following methods: 1. An init method to set the company name 2 A method that lets the user add a part to the list of parts a company supplies 3. A method that takes a part argument and returns the cost of that part. 4. A method that takes a part argument and returns a Boolean if the part is supplied by the company (True if it does, False if it does not). The database class will need the following data: 1. A list of suppliers The database class will need the following methods: 1. An init method to initialize the database 2. A method to add a supplier 3. A method to find the lowest cost for a part. The input will ba a part name, and the outrout will ba two values: the name of the suppoller. and the cost. if the part is not sold by any suppliers, retum False. False. Unlike in other programs - you do not need to write the code for user insot, input validation, ar output - you need only to write the classes! The sompany has supplied the program to load in the data and get the data from the clusses. you need only to define the classes (and test with the sunplied program of coura)! Additional requirements 2. You MUST use modules. you need to write your 3 classez in 3 zeparate Pythen flles named databaze py, part by and suoclen By 2. Do NOT mosify the suppled Python code - A will test your files with my own Python cede - If you have to change the providied Fy thon code to get your classea to work. you'll lose ooints.
Additional requirements 1. You MUST use modules, you need to write your 3 classes in 3 separate Python files named database.py, part.py and supplier.py 2. Do NOT modify the supplied Python code - I will test your files with my own Python code - if you have to change the provided Python code to get your classes to work, you'll lose points. 3. Submit only the 3 python files - part.py, supplier.py and database.py 4. Each Python file must have a program headert Supplied Python Code import database ìnport supplier inport part supplier_database = database.Database() while True: data = input/"Enter supplier name, or quit to exit: ") if data =a "quit". break s = supplier.Supplier(data) print("Part info should be entered in the following format: name, price") while True: part_info = input"("Enter part info, or quit to exit.) if part_info == "quit": print0 break try: name, price = part_info.split(".) price = float(price) except: print("Error input - Part info should be entered in the following format: name, price - please try again?) continue s.add_part(name, price) supplier_database.add_supplier(s) print( Ininsupplier database completelln") While True: data = inout("Please enter in a part name or quit to exit: ") if data a "quit": break supolier, price a supolier_database find_partidata) if supplier a folse: orinti" Error part does not exist in database?) else. orint f'fart (data) is available for the best price at (supplier) Price: S(erice 2t) print:" nthankyou for using the erice databasel? Sample input/Output Enter dupoliername or quit to exit Werld Perts. ine Fant info thould be entered in the fallawhy fomat name parde Enter pant info er auit to ext glame. \$ Qर Entercat infe. er âuit to a st serechot \$1 12 Enter ealt infs or aset te eat oud
Sample Input/Output Enter supplier name, or quit to exit: World Parts, Inc Part info should be entered in the following format name, price Enter part info, or quit to exit: gizmo, 199 Enter part info, or quit to exit: sprocket, 3.12 Enter part info, or quit to exit quit Enter supplier name, or quit to exit: ABC Manufacturing Part info should be entered in the following format: name, price Enter part info, or quit to exit: sprocket, 3.09 Enter part info, or quit to exit: gizmo, 234 Enter part info, or quit to exit dodad, 13.99 Enter part info, or quit to exit quit Enter supplier name, or quit to exit, quit Supplier database completel Please enter in a part name or quit to exit gizmo Part gizmo is available for the best price at World Parts, Inc. Price: 51.99 Please enter in a part name or quit to exit: sprocket Part sprocket is available for the best price at AEC Manufacturing. Price: 53.09 Please enter in a part name or quit to exit: dodad Part dodad is available for the best price at ABC Manufacturing. Price: 513.99 Please enter in a part name or quit to exit: quit Thank you for using the price database! Tips Provided By Professor: 1. The provided code does all the input/output for this program. You only need to write the the 3 classes. 2 Some of the methods for the 3 classes need to be of a specific format or the supplied pro not work - these are the init methods for Suppler and Database, and add_part, add_supol find_part. Make sure you have those methods defined in your program and that their signa matches what the provided code expects. 3. Write the classes from simple to more complex - start with Part, then Supplier, then Data
Hoping for help figuring out a Python assignment Your work on the last project, the inventory ordering system, was so we
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Hoping for help figuring out a Python assignment Your work on the last project, the inventory ordering system, was so we
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!