Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2015 Porto Portugal September 7 11 2015 Proceedings Part 3 Lnai 9286

Authors: Albert Bifet ,Michael May ,Bianca Zadrozny ,Ricard Gavalda ,Dino Pedreschi ,Francesco Bonchi ,Jaime Cardoso ,Myra Spiliopoulou

1st Edition

3319234609, 978-3319234601

More Books

Students also viewed these Databases questions

Question

How might IMC fail, and what counter measures could be taken?

Answered: 1 week ago