Pycharm - Python
Foundations of Programming, Data Structures, and Algorithms
Project 4 – Movie Lover’s Club
The Movie Lover’s Club is a club of persons that love to watch movies and keep track of how many times
they have watched the movies they love.
The club president, Al Hitchcock, has hired you to create a simple, text-based program that will allow
him to enter, update, and retrieve information about the movies that his club members love.
The main menu that is provided by the program will look as follows:
Welcome to the Movie Lover's Club
1. Display all members
2. Display all movie information for a member
3. Increment the times a specific movie was watched by a member
4. Add a movie for a member
5. Add a new member
Q. Quit
Please enter a selection:
For menu option 1 (Display all users), you should display all club members.
Club Members
===================
Mary
Frank
For menu option 2 (Display all movie information for a member), you should prompt for the member
name and display all movie information for that member. The member name must exist otherwise you
should display an error message.
Please enter a selection: 2
Please enter the user's name: Frank
Movies for club member: Frank
Movie Rating Watched
========================================
Beauty and the Beast G 1
Kung Fu Panda G 5
Cinderella G 1
Foundations of Programming, Data Structures, and Algorithms
Please enter a selection: 2
Please enter the user's name: James
Sorry, member not found
For menu option 3 (Increment the number of times a specific movie was watched by a member), prompt
the user for the member’s name and then for the movie name. Both these items must exist otherwise
you should display an error message.
Please enter a selection: 3
Please enter the member's name: Mary
Please enter the name of the movie: Superman
Times watched incremented
Please enter a selection: 3
Please enter the member's name: James
Sorry, member not found
Please enter a selection: 3
Please enter the member's name: Frank
Please enter the name of the movie: Star Wars
Sorry, movie title not found
For menu option 4 (Add a movie for a member), prompt the user for the member’s name and then for
the movie information. The member name must exist and the movie name must not already exist
otherwise you should display an error message.
Please enter a selection: 4
Please enter the member's name: Frank
Enter movie name: Star Wars
Enter times watched: 3
Enter rating: PG-13
Movie added
Foundations of Programming, Data Structures, and Algorithms
Please enter a selection: 4
Please enter the member's name: James
Sorry, member not found
Please enter a selection: 4
Please enter the member's name: Frank
Enter movie name: Cinderella
Sorry that movie already exists
For menu option 5 (Add a new member), prompt the user for the new member’s name and add the user
information. The member name must not otherwise you should display an error message. Note that no
movie information should be added for the new member.
Please enter a selection: 5
Enter the new member's name: Kevin
Member added
1. Display all members
2. Display all movie information for a member
3. Increment the times a specific movie was watched by a member
4. Add a movie for a member
5. Add a new member
Q. Quit
Please enter a selection: 1
Club Members
===================
Mary
Frank
Kevin
Foundations of Programming, Data Structures, and Algorithms
1. Display all members
2. Display all movie information for a member
3. Increment the times a specific movie was watched by a member
4. Add a movie for a member
5. Add a new member
Q. Quit
Please enter a selection: 2
Please enter the user's name: Kevin
Movies for club member: Kevin
Movie Rating Watched
========================================
Hints
You must use a Python Dictionary as the data structure that will hold all the movie and user information.
You may structure this Dictionary in any way you like. However, you may use the following Dictionary if
you wish.
movies = { 'Mary': {'Big': { 'Watched': 1, 'Rating': 'G' }, 'Superman': { 'Watched': 3, 'Rating': 'PG' }, 'Forrest Gump': { 'Watched': 3, 'Rating': 'PG-13' } }, 'Frank': {'Beauty and the Beast': { 'Watched': 1, 'Rating': 'G'
Foundations of Programming, Data Structures, and Algorithms
}, 'Kung Fu Panda': { 'Watched': 5, 'Rating': 'G' }, 'Cinderella': { 'Watched': 1, 'Rating': 'G' } } }
The overall logic of the program is straightforward. You may use the following structure as a starting
point if you wish:
print("Welcome to the Movie Lover's Club") while True: #Display the main print("1. Display all members") # Get the menu selection from the user # and make sure it is valid if selection == '1': # do it if selection == '2': # do it if selection == '3': # do it if selection == '4': # do it if selection == '5': # do it if selection == 'Q': # do it
Foundations of Programming, Data Structures, and Algorithms
print("Thanks for using the Movie Lover's Club application!")
- Project 4 – Movie Lover’s Club