Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python please The goal of the project is to design and implement a basic media library system in which administrators (you) can inquire the

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed In python please
The goal of the project is to design and implement a basic media library system in which administrators (you) can inquire the current inventory, and add or remove items. These items are identified either as books as follows. Each entry in the library can be identified by its media type (Movie or Book), its Title, its Reference, and its Price. A sample media library comprised of 9 items is given in Table 1 11.99 10.I ime Zarathustra aabout by its Author, while a movie media item The project must include three files: 1. Medialtem.py file/module that contains the user-defined type (object data) Medialtem. 2. inventory.py file/module that contains all the necessary functions to operate the inventory 3. media-store.py file containing the main program. At the first execution of the program media-store.py, the output includes a menu containing 9 options: Welcome to BestMedia Mens 1-List Inventory 2-Info Inventory 3-List of All Books 4-List of All Movies 5-Item Description 7-Add Item B-Set Maximun Price O-Exit Once option 0 (for Exit) is selected, the program stops. All the options will be reviewed below. The project is designed to be incremental, you can then debug, test and run your co to comment your code. Make sure you obtain the exact same output for the exact same input for the examples (this includes syntax, blank spaces, and skipping blauk lines), Your program will also be tested After Task 1 done all the other Tasks/opstions can be I in any order. Do not fonget l. ts by the This project will be graded out of 100 points: 1. Your program should implement all basic functionality/Tasks and run correctly (90 points). 2. Overall programming style: program should have proper identification, and comments. (10 points). Option-1- 130pts] Let us first see what is happening when option 0 is selected. 4-Liat of Al1 Movies O-Exit Enter Command: 0 Goodbye! Let us then see what is happening when option I is selected. Reference/Media/Title/Price (nax-$100.0) TU2RL012 Movie 2001: A Space Odyssey $11.99 GVSN32M9 Book A Brief History of Time $10.17 POSTTY89 Movie The Good, The Bad and The Ugly s9.99 TR3FLOEH Book The Alchenist $6.99 F209PIE9 Book Thus Spoke Zarathustra $7.81 Book Livingston Seagul1 $6.97 2FG6B3N9 Movie Gone vith the Wind $4.99 6Y9OPL87 Book Gone vith the Wind $7.99 2-Into Inventory 3-List of All Books 4-Liat of Al1 Movies Iten 7-Add Ites 8-Set Maxiaus Price Here an inventory of the medin store displayed, we can see the referenres, media type, title and price of each items. The maximum price is set to $100 meaning that all the iteas with a price bekow $100 will be At the end the menn selection is printed again and the program is waiting for you to listed in the What you need to implement What you need to implement: . In the media.store.py file: (1) The welcoming message, (2) a call to a function initialize t return a list of items (data objects of type Medialtem keeps track of the maximum price (initialize to $100 ned further below), (3) a variable that at first), (4) a while loop that keeps printing the selection and asking the user to enter a command choice; this while loop will exit if the eutry is a 'Goodbye!' message; the function to print the menu, display.menu, is already provided to you in the file inventory.py; (5) the option 1 that contains a call to a function display (you can use as arguments the list of items and the maximum price). We note that the header of the file already contains the instruction import inventory which will allow you to call the functions in the inventory file using the dot operator 2. In the Medialten. py file: A class that define the type data objeet Medialtem that includes the constructor (ie. function init). You will consider the following attributes: nedia, titie, price, price, ref, director, lead actor, author. All the attributes can be initialieed to Hone by default 3. In the Inventory.py file: (1) the initialize function that creates and returns a list of Medialtem data objects. Ideally we would like to read all the inventory from a fBle (so we conld easily consider 1000s of items if needed) but we will do that later in the semester. Here, you will need to fill up by 1 9 itemas presented in Tables 1 and of the title, ete, froim this pdf file) will allow you to ase the Medialtem data type. allow you to use the M Option-2- [15pts) Option-2- [15pts] Let us now see what is happening when option 2 is selected. Inventory is vorth $75.89 Mt expensive item at $11.99 There are 5 Book(s), and 4 Movie(s) Menu 2-Info Inventory 3-List of Al1 Books 4-List of All Movies 6-Renove Item 7-Add Iten 8-Set Maxinun Price The program is displaying some info about the inventory, the total value of all the media items, the price of the most expensive items, and the total number of books and movies found in the whole inventory What you need to implement 1. In the sedia.store.py file: the option 2 that arguments the list of items) 2. In the Inventory.py file: the function info that displays the itemns as preseuted in the output example You will probably needs a for loop that scans through all members of the ist of media items. To find the maximum price you could implement the linear search algorithm seen in elass Option-3 and 4- [10pts Let us now see what is happening when option 3 and then option 4 are selected : 3 Reference/Media/Title/Price (max-$100.0) GVSN32M9 Book A Briet History of Tine $10.17 F209PE9 Book Thus Spoke Zarathustra $7.81 R399CED1 Book Jonathan Livingaton Seagull $6.97 6Y90PL87 Book Gone vith the Vind $7.99 Menu 1-L.ist Inventory 2-Info Inventory 3-List of All Books 5-Iten Description 7-Add Item 8-Set Maximun Price 0-Exit Reference/Media/Title/Price (nax-$100.0) TU2RL012 Movie 2001: A Space odyssey $11.99 1DBGHK3L Movie North by Northvest $8.99 POSTTY89 Movie The Good, The Bad and The Ugly #9.99 2FG6B3N9 Movie Gone vith the Vind $4.99 1-List Inventory 4-Liat of A21 Movies 6-Resove Item 7-Add 1ten Command This is very similar to option 1 but either the media Book items or Movie items are displayed. Ia Option 3, and 4 you could use the funetion display that would need to be modified to include an additional argument about the nature of the media. Option-5- [10pts] Let us now see what is happening when option 5 is selected (here we do it three times). : 5 Enter iten reference: 1DB6HK3L Title: North by Northwest (Ret: IDBGHK3L, Price: $8.99) Movie Director: Alfred Hitchcock; Lead Actor: Cary Grant Mena 1-List Isventory 3-Liat of A11 Books 4-Liat of Al1 Movies T-kdd 1tes 8-Set Max san Price Enter iten reference Author: Richard Bach Inventory Inventory 3-List of All Books 5-Ites Description 7-Add Iten Enter Conmand: 5 3-List of Al1 Books 4-List of All Movies Enter Command about iten that re- Price O-Exit Reference/Media/Title/Price (max-$100.0) TR3FLOEN Book The Alchenist $6.99 F209PIE9 Book Thus Spoke Zarathustra $7.81 R399CED1 Book Jonathan Livingston Seagull $6.97 6Y9OPL87 Book Gone vith the Wind $7.99 Inventory 2-Iafo Inrentory 3-List of A11 Books 4-List of All Movies 7-Add Iten 8-Set Maxiaus Price Inventor1worth S65.72 Thare aze 4 Book(a), and 4 Movie(s) 1-Lias I 2-Info Inventory 3-List of All Books 4-List of All Movies 5-Item Description 6-Remove Iten 7-Add Item The program is asking the user to enter a particular reference and the corresponding items will be removed from the inventory as seen in the example when you select option 1 the book "A Brief History of Time"is not there anymore. It also disappears from the list of books (since it is a book). Option 2 can return the new info about the new inventory that now only contains 8 items. What you need to implement: 1. In the sedia.store.py file: the option 6 that could include a call to a function search index.item to return the index of the item to remove from the list. We have seen in class how the built-in del function can be used to then remove an item with a given index from a list (and left shift all the other items with higher indexes). 2. In the Inventory.py file: the method above. Option-7- [10pts] Let us now see what is happening when option 7 is selected (we use it three times here, follows by option 1 and then 2) Enter Comnand: 7 Enter Book Title: Hanlet Ester Book Price: 4.59 Reference/Media/Title/Price (nax-$100.0) TU2RL012 Movie 2001: & Space Odyssey $11.99 LDBEHK3L Movie North by Northvest $8.99 POSTTY89 Movie The Good, The Bad and The Ugly $9.99 TR3FLOEW Book The Alchemist $6.99 F209P1E9 Book Thus Spoke Zarathustra $7.81 R399CEDI Book Jonathan Livingston Seagull 6.97 2F06B3N9 Movie Gone vith the Wind $4.99 6Y90PL87 Book Gone vwith the Vind $7.99 J45K99EE Book Hanlet $4.59 ERB9QW43 Hovie The Great Eacape $7.99 1-List Inventory 2-Into Inventory 3-Liat of All Books 4-List of A11 Movies 5-Iten Description 7-Add Iten 8-Set Maxinun Price Iaventory is vorth $78.3 Most expenaive iten at $11.99 There are 5 Book(s), and 5 Mavie(a) 1-List Inventory 2-Info Inventory 3-List of All Books 4-List of A1l Movies 5-Item Description 6-Remove Item 7-Add Item 8-Set Maximum Price o-Exit For option 7, once you ask the user to enter which media to select (Book or Movie), you will need a new function create.item that returns a new data object Medialtem and append it to the list (creating then a new inventory Option-8- [5pts Finally, let us now see what is happening when option 8 is selected (follow by option 1 here) Enter Command: 8 Enter maximun price (current-$100.0): 8.0 1-List Inventory 2-Info Inventory 3-List of Al1 10 4-List of All Movies 5-Item Description 6-Remove Iten 7-Add Iten o-Exit Enter Command: 1 Reference/Media/Title/Price (nax-$8.0) TR3FLOEN Book The Alchemist $6.99 F209PIE9 Book Thus Spoke Zarathustra $7.81 R399CED1 Book Jonathan Livingston Seagull $6.97 2FG6B3N9 Movie Gone with the Wind $4.99 6Y90PL87 Book Gone with the Wind $7.99 J45K99EE Book Hanlet $4.59 ER890W43 Movie The Great Escape $7.99 1-List Inventory 2-Info Inventory 3-List of All Books 4-List of A11 Movies 5-Item Description 7-Add Iten um price. Using option 1, the inventory will not display the items option 2, but will affect The user is asked to enter a new m that have a higher price (items are not removed, just hidden, so it will not affect options 3 and 4). The goal of the project is to design and implement a basic media library system in which administrators (you) can inquire the current inventory, and add or remove items. These items are identified either as books as follows. Each entry in the library can be identified by its media type (Movie or Book), its Title, its Reference, and its Price. A sample media library comprised of 9 items is given in Table 1 11.99 10.I ime Zarathustra aabout by its Author, while a movie media item The project must include three files: 1. Medialtem.py file/module that contains the user-defined type (object data) Medialtem. 2. inventory.py file/module that contains all the necessary functions to operate the inventory 3. media-store.py file containing the main program. At the first execution of the program media-store.py, the output includes a menu containing 9 options: Welcome to BestMedia Mens 1-List Inventory 2-Info Inventory 3-List of All Books 4-List of All Movies 5-Item Description 7-Add Item B-Set Maximun Price O-Exit Once option 0 (for Exit) is selected, the program stops. All the options will be reviewed below. The project is designed to be incremental, you can then debug, test and run your co to comment your code. Make sure you obtain the exact same output for the exact same input for the examples (this includes syntax, blank spaces, and skipping blauk lines), Your program will also be tested After Task 1 done all the other Tasks/opstions can be I in any order. Do not fonget l. ts by the This project will be graded out of 100 points: 1. Your program should implement all basic functionality/Tasks and run correctly (90 points). 2. Overall programming style: program should have proper identification, and comments. (10 points). Option-1- 130pts] Let us first see what is happening when option 0 is selected. 4-Liat of Al1 Movies O-Exit Enter Command: 0 Goodbye! Let us then see what is happening when option I is selected. Reference/Media/Title/Price (nax-$100.0) TU2RL012 Movie 2001: A Space Odyssey $11.99 GVSN32M9 Book A Brief History of Time $10.17 POSTTY89 Movie The Good, The Bad and The Ugly s9.99 TR3FLOEH Book The Alchenist $6.99 F209PIE9 Book Thus Spoke Zarathustra $7.81 Book Livingston Seagul1 $6.97 2FG6B3N9 Movie Gone vith the Wind $4.99 6Y9OPL87 Book Gone vith the Wind $7.99 2-Into Inventory 3-List of All Books 4-Liat of Al1 Movies Iten 7-Add Ites 8-Set Maxiaus Price Here an inventory of the medin store displayed, we can see the referenres, media type, title and price of each items. The maximum price is set to $100 meaning that all the iteas with a price bekow $100 will be At the end the menn selection is printed again and the program is waiting for you to listed in the What you need to implement What you need to implement: . In the media.store.py file: (1) The welcoming message, (2) a call to a function initialize t return a list of items (data objects of type Medialtem keeps track of the maximum price (initialize to $100 ned further below), (3) a variable that at first), (4) a while loop that keeps printing the selection and asking the user to enter a command choice; this while loop will exit if the eutry is a 'Goodbye!' message; the function to print the menu, display.menu, is already provided to you in the file inventory.py; (5) the option 1 that contains a call to a function display (you can use as arguments the list of items and the maximum price). We note that the header of the file already contains the instruction import inventory which will allow you to call the functions in the inventory file using the dot operator 2. In the Medialten. py file: A class that define the type data objeet Medialtem that includes the constructor (ie. function init). You will consider the following attributes: nedia, titie, price, price, ref, director, lead actor, author. All the attributes can be initialieed to Hone by default 3. In the Inventory.py file: (1) the initialize function that creates and returns a list of Medialtem data objects. Ideally we would like to read all the inventory from a fBle (so we conld easily consider 1000s of items if needed) but we will do that later in the semester. Here, you will need to fill up by 1 9 itemas presented in Tables 1 and of the title, ete, froim this pdf file) will allow you to ase the Medialtem data type. allow you to use the M Option-2- [15pts) Option-2- [15pts] Let us now see what is happening when option 2 is selected. Inventory is vorth $75.89 Mt expensive item at $11.99 There are 5 Book(s), and 4 Movie(s) Menu 2-Info Inventory 3-List of Al1 Books 4-List of All Movies 6-Renove Item 7-Add Iten 8-Set Maxinun Price The program is displaying some info about the inventory, the total value of all the media items, the price of the most expensive items, and the total number of books and movies found in the whole inventory What you need to implement 1. In the sedia.store.py file: the option 2 that arguments the list of items) 2. In the Inventory.py file: the function info that displays the itemns as preseuted in the output example You will probably needs a for loop that scans through all members of the ist of media items. To find the maximum price you could implement the linear search algorithm seen in elass Option-3 and 4- [10pts Let us now see what is happening when option 3 and then option 4 are selected : 3 Reference/Media/Title/Price (max-$100.0) GVSN32M9 Book A Briet History of Tine $10.17 F209PE9 Book Thus Spoke Zarathustra $7.81 R399CED1 Book Jonathan Livingaton Seagull $6.97 6Y90PL87 Book Gone vith the Vind $7.99 Menu 1-L.ist Inventory 2-Info Inventory 3-List of All Books 5-Iten Description 7-Add Item 8-Set Maximun Price 0-Exit Reference/Media/Title/Price (nax-$100.0) TU2RL012 Movie 2001: A Space odyssey $11.99 1DBGHK3L Movie North by Northvest $8.99 POSTTY89 Movie The Good, The Bad and The Ugly #9.99 2FG6B3N9 Movie Gone vith the Vind $4.99 1-List Inventory 4-Liat of A21 Movies 6-Resove Item 7-Add 1ten Command This is very similar to option 1 but either the media Book items or Movie items are displayed. Ia Option 3, and 4 you could use the funetion display that would need to be modified to include an additional argument about the nature of the media. Option-5- [10pts] Let us now see what is happening when option 5 is selected (here we do it three times). : 5 Enter iten reference: 1DB6HK3L Title: North by Northwest (Ret: IDBGHK3L, Price: $8.99) Movie Director: Alfred Hitchcock; Lead Actor: Cary Grant Mena 1-List Isventory 3-Liat of A11 Books 4-Liat of Al1 Movies T-kdd 1tes 8-Set Max san Price Enter iten reference Author: Richard Bach Inventory Inventory 3-List of All Books 5-Ites Description 7-Add Iten Enter Conmand: 5 3-List of Al1 Books 4-List of All Movies Enter Command about iten that re- Price O-Exit Reference/Media/Title/Price (max-$100.0) TR3FLOEN Book The Alchenist $6.99 F209PIE9 Book Thus Spoke Zarathustra $7.81 R399CED1 Book Jonathan Livingston Seagull $6.97 6Y9OPL87 Book Gone vith the Wind $7.99 Inventory 2-Iafo Inrentory 3-List of A11 Books 4-List of All Movies 7-Add Iten 8-Set Maxiaus Price Inventor1worth S65.72 Thare aze 4 Book(a), and 4 Movie(s) 1-Lias I 2-Info Inventory 3-List of All Books 4-List of All Movies 5-Item Description 6-Remove Iten 7-Add Item The program is asking the user to enter a particular reference and the corresponding items will be removed from the inventory as seen in the example when you select option 1 the book "A Brief History of Time"is not there anymore. It also disappears from the list of books (since it is a book). Option 2 can return the new info about the new inventory that now only contains 8 items. What you need to implement: 1. In the sedia.store.py file: the option 6 that could include a call to a function search index.item to return the index of the item to remove from the list. We have seen in class how the built-in del function can be used to then remove an item with a given index from a list (and left shift all the other items with higher indexes). 2. In the Inventory.py file: the method above. Option-7- [10pts] Let us now see what is happening when option 7 is selected (we use it three times here, follows by option 1 and then 2) Enter Comnand: 7 Enter Book Title: Hanlet Ester Book Price: 4.59 Reference/Media/Title/Price (nax-$100.0) TU2RL012 Movie 2001: & Space Odyssey $11.99 LDBEHK3L Movie North by Northvest $8.99 POSTTY89 Movie The Good, The Bad and The Ugly $9.99 TR3FLOEW Book The Alchemist $6.99 F209P1E9 Book Thus Spoke Zarathustra $7.81 R399CEDI Book Jonathan Livingston Seagull 6.97 2F06B3N9 Movie Gone vith the Wind $4.99 6Y90PL87 Book Gone vwith the Vind $7.99 J45K99EE Book Hanlet $4.59 ERB9QW43 Hovie The Great Eacape $7.99 1-List Inventory 2-Into Inventory 3-Liat of All Books 4-List of A11 Movies 5-Iten Description 7-Add Iten 8-Set Maxinun Price Iaventory is vorth $78.3 Most expenaive iten at $11.99 There are 5 Book(s), and 5 Mavie(a) 1-List Inventory 2-Info Inventory 3-List of All Books 4-List of A1l Movies 5-Item Description 6-Remove Item 7-Add Item 8-Set Maximum Price o-Exit For option 7, once you ask the user to enter which media to select (Book or Movie), you will need a new function create.item that returns a new data object Medialtem and append it to the list (creating then a new inventory Option-8- [5pts Finally, let us now see what is happening when option 8 is selected (follow by option 1 here) Enter Command: 8 Enter maximun price (current-$100.0): 8.0 1-List Inventory 2-Info Inventory 3-List of Al1 10 4-List of All Movies 5-Item Description 6-Remove Iten 7-Add Iten o-Exit Enter Command: 1 Reference/Media/Title/Price (nax-$8.0) TR3FLOEN Book The Alchemist $6.99 F209PIE9 Book Thus Spoke Zarathustra $7.81 R399CED1 Book Jonathan Livingston Seagull $6.97 2FG6B3N9 Movie Gone with the Wind $4.99 6Y90PL87 Book Gone with the Wind $7.99 J45K99EE Book Hanlet $4.59 ER890W43 Movie The Great Escape $7.99 1-List Inventory 2-Info Inventory 3-List of All Books 4-List of A11 Movies 5-Item Description 7-Add Iten um price. Using option 1, the inventory will not display the items option 2, but will affect The user is asked to enter a new m that have a higher price (items are not removed, just hidden, so it will not affect options 3 and 4)

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

More Books

Students also viewed these Databases questions

Question

a. How are members selected to join the team?

Answered: 1 week ago

Question

b. What are its goals and objectives?

Answered: 1 week ago