Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE USE PYTHON Description For this assignment you will write a program to simulate a media library. We will work with three types of media:

PLEASE USE PYTHON

image text in transcribed

image text in transcribed

Description For this assignment you will write a program to simulate a media library. We will work with three types of media: pictures, music, and movies. Your job is to design and implement a class hierarchy consisting of the Media, Picture, Song, and Movie classes, as described below Specification for the classes Media class A Media object has a media type, a name, and a rating. The rating is an integer number. You need to implement the init ,getter, and setter methods as needed This class should overload the str displayed using the print ) function or repr methods so that Media objects can be Movie class A Movie is a type of Media that has a director and running time (given in minutes). This class has a play) method that will simulate the task of playing a movie (you can do something simple as printing: '>, playing now'. The Movie class should override the str or reprmethod of Media. Make sure you also implement any other methods (such as_ init_ ,getters, and setters) as needed by Movie. You should be able to use the str _(or_repr_) method in a script to show all the movie information, including media type, name, rating, director, and running time Song class A Song is a kind of Media that has an artist and an album. This class has a play () method that will simulate the task of playing a song (you can do something simple as printing something like > by >, playing now'. The Song class should override the str (or repr method of Media. Make sure you also implement any other methods (such as init , getters, and setters) as needed by Song. You should be able to use the str media type, name, rating, artist, and album (or_repr_) method in a script to show all the song information, including Picture class A Picture is a kind of Media that has a resolution. The resolution of a picture is an integer number that measures the dots per inch (the minimum resolution of any picture should be 200 dpi). This class has a show () method that will simulate the task of displaying a picture (you can do something simple as printing: 'Showing >. The Picture class should override the_ str (or_repr_) method of Media. Make sure you also implement any other methods (such as__init__,getters, and setters) as needed by Picture. You should be able to use the str (or_repr_) method in a script to show all the picture information, including media type, name, rating, and resolution. Script Your script will simulate a media library. You should have a list of Media that stores at least 12 different objects. Your list should have a mix of Song, Movie, and Picture objects. You will provide the information for each media object when you populate the list. Your program should have a menu that allows the user to perform the following actions: Display all items in the Media library Display only the Song objects Display only the Movie objects Display only the Picture objects Play a Song: the user enters the name of the Song. If the Song is found play it. If not, display a message indicating that the Song is not in the media library. Play a Movie:the user enters the name of the Movie. If the Movie is found play it. If not, display a message indicating that the Movie is not in the media library. Display a Picture: the user enters the Picture. If the Picture is found display it. If not, display a message indicating that the Picture is not in the media library. Quit the program You will need a loop to show and process the menu until the user chooses to quit/exit the program

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

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

Did you pick a topic that you know all about?

Answered: 1 week ago

Question

How does teacher immediacy affect learning?

Answered: 1 week ago