Question
Build on the code below using your knowledge of python classes and implement a Movie Library App with the Specifications that follow: genres = []
Build on the code below using your knowledge of python classes and implement
a Movie Library App with the Specifications that follow:
genres = []
#add movies, remove movies, rent out a movie,check availability of a movie, add a genre, available movies
movies = ['little women','after','second act','indivisible','the choice','the intern','Bad Boys for Life']
menu = ['Add New Movie',
'Rent out a Movie',
'Check Movie Availabilty',
'Add a Genre',
'Get Number of Movies',
'Quit']
print('\t===Movie App=== ')
while True:
#Loop thru out list of menu items
print('Pick an option to continue')
i=0
while i < len(menu):
print('\t'+str(i)+'-'+menu[i])
i+=1
choice = input('Pick an operation to continue ')
try:
choice = int(choice)
if(choice>=len(menu)):
print("Invalid selection, try again")
if choice == 5:
break
if choice == 0:
movie_name = input("Please enter the movie name ")
print("Your previous list of movies is:",movies)
movies.append(movie_name)
print("Movie Added , Your new list of movies is:",movies)
except Exception as e:
print("Error Occured:",e)
print("You chose to quit, bye")
exit(0)
Each movie should have the following attributes:
Name eg The Girl on the Train
Director: eg Tate Taylor
Writer: eg Erin Cressida Wilson
Cast: eg Emily Blunt, Rebecca Ferguson, Haley Bennett, Justin Theroux, Luke Evans
rating: eg Rated R,thriller,drama,romance,horror
Number of copies and number of available copies in the library
Year of release
The app should mantain a list of registered members each member having the following attributes:
first name, middle name, last name
username
phone
date of birth
The app should allow the following operations by the owner
add a movie by specifying its attributes
add a new member after paying membership fee of 10,000
renew membership of a member.
check availability of a movie (a movie is availability if there is still atleast a copy of the movie in the library not borrowed by a member)
check number of copies of a given movie in the library
rent out a movie searched by attribute eg name, year, director etc
check who is having which movie
change/update attribute of a movie (eg genre, year etc)
delete a movie from the library probably after losing it to a bad member
search movies by attribute eg genre, director, year etc. In which case the app should print names of movies with that attribute
The app has the following constraints:
a member cannot borrow more than 3 movies at the same
app should not allow a member below 18 years to borrow, horror, violent and rated movies
a member cannot borrow a movie if his/her subscription has expired.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started