QuestionQuestion

You will write a basic movie management system. Your program will let the user to enter information about set of movies and then issue commands to edit or sort information about the movies.
You will implement a simple shell program which will allow the user to enter commands. Your program should print out a prompt to indicate that the user can enter a command. Your prompt should be a ‘$’ character. At the prompt the user will type a command followed by a set of arguments for the command. Your program will perform whatever action is indicated by the command, and then your program will print a ‘$’ character on a new line in order to let the user know that he/she can type a new command.
Your program should accept the following commands.

1. addmovie: This command indicates that the user wants to enter the information about a new movie into the system. This command takes no arguments. When this command is issued, the shell will prompt the user for 4 pieces of information about the movie: the movie title, the year released, IMDB rating (a float), and the directors name, separated by commas. This command adds the information about the new movie into the system.
2. printmovies: This command prints all the information about the movies which have been entered into the system. This command takes no arguments. The information about each movie is printed on a separate line. Each line should have four pieces of information on it: the movie title, the year released, IMDB rating, and the directors name, separated by commas.
3. deletemovie: This command indicates that the user wants to delete the information about a movie from the system. This command should be followed by one argument, the name of the movie.
4. sortratings: This command indicates that the user wants to view the movies based on the ratings given by IMDB. This command takes no arguments. This command will print the information about the movies which have been entered into the system, sorted by their IMDB ratings. The information about each movie is printed on a separate line. Each line should have four pieces of information on it: the movie title, the year released, IMDB rating, and the directors name, separated by commas.
5. findyear: This command searches for all books with a certain release year. The command should be followed by one argument, the release year. For each movie in the system with the given release year, the movie’s information should be printed on a single line: the movie title, IMDB rating, and the directors name, separated by commas.
6. findmovie: This command searches the system for a movie with a certain name. The command should be followed by one argument, the name of the movie. If a movie with
the given name is in the system, the movie’s information should be printed on a single line: the year released, IMDB rating, and the directors name, separated by commas.
7. quit: This command should end the program

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

# Main method containing program execution
def main():
    # List to store movie information
    movielist = []
    # Run program in a main loop
    while True:
       # Query user input
       cmd = input("$ ")
       # addmovie command
       if cmd == "addmovie":
            try:
                title = input("Movie Title: ")
                year = input("Year Released: ")
                rating = float(input("IMDB Rating: "))
                director = input("Director: ")
                movielist.append((title, year, rating, director))
            except:
                print("Error: Invalid input")
       # printmovies command
       elif cmd == "printmovies":
            for title, year, rating, director in movielist:
                print(title + ", " + year + ", " + str(rating) + ", " + director)
       # deletemovie command
       elif len(cmd) > 12 and cmd[:11] == "deletemovie":
            deleteTitle = cmd...

By purchasing this solution you'll be able to access the following files:
Solution.PNG and Solution.py.

50% discount

Hours
Minutes
Seconds
$45.00 $22.50
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Python Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats