After completing this assignment you will have practiced overloading operators for programmer defined classes and using inheritance.
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 Mass hierarchy consisting of the Media, Picture, Song, and Movie classes, as described below.
All the following classes are to be implemented M a single module media.py.
The media Mass will be the abstract base class to be inherited by our song, movie and Picture Masse, All media objects should have a name and a rating. The rating is an integer number (think of this as the number of stars given).
We will leave many design decisions to you, however you should implement at least the following methods: •
_snit (name, rating): Where name is a string and rating is an integer.
• getmame() Returns the name of the media as a string
• str (): Returns a string representation of a generic Media object in the format «media Type here»: «name here», «rating here» stars.
• getmatinga Returns the rating as an integer.
• setmating(value): Takes an integer parameter, and changes the rating of the object.
In addition, you should have a static abstract method add() that takes no parameters.
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: «movie name here» playing now The movie class should override the str method of its parent media class (although it can also use it!).
Make sure you also implement at Mast the following methods:
• A constructor Your constructor should take all the information needed to initialize the parent class, as well as the director as a string and the running time as a number. The order of the arguments should be name, rating, director, running_time.
• getoirector ( ): Retums the director as a string
• setoirector (name): Sets the director using the string name.
• getsunningTimea Retums the running time as a number.
• setsunningTime(time): Sets the running time using the integer time.
• playa Prints «movie name here» playing now.
• str (): Returns a string representation of the movie object in the format movie: «movie name », «rating» stars, Directed by: «director», gunning time: «running time» minutes.
In addition you will have to implement the add() method for this class. This method should be static, should prompt the user to enter the necessary information to create a movie object, and retums a new instance of movie as follows:
Enter movie name:
Enter director:
Enter movie duration:
Enter rating:
Movie added:
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 (see description below). The song class should override the str method of media.
In addition, you should implement the following methods:
• A constructor Your constructor should take all the information needed to initialize the parent class, as well as the artist and album. The order of the arguments should be name, rating, artist, album.
• getArtist(): Returns the artist as a string
The order of the arguments should be name, rating, artist, album.
• getArtist a Returns the artist as a string
• setArtist(name): Sets the artist name to the string name.
• gerydbum(), Returns the album name as a string
• serydbum(name): Sets the album name to the string name.
• playa Prints «song name here» by «artist name here» playing now.
• str (): Returns a string representation of the song object in the tarn song: «song name », «rating» stars, artist: «artist», Album: «album».
Like the movie class, this should have a static add() method that prompts the user to enter the necessary information to create a song object, and returns a new instance of song. The format of the prompts is
Enter song name:
Enter artist:
Enter album:
Enter rating:
Song added!
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).
The Picture class should implement at least the following methods:
• A constructor. Sour constructor should take all the information needed to Initialize the parent class, as well as the dots-pen nch of the picture, as an integer. The order of the arguments should be name, rating, dpi.
• getResolutiona Returns the dpi as an integer.
• setResolution(value): Changes the dd. The parameter value is an integer.
• show(): Prints showing «picture name here».
• str (): Returns a string representation of the Picture in the form: Picture: «picture name », «rating» stars, Resolution: «dpi» dpi.
Like the previous derived classes, this should also have a static add() method that prompts the user to enter the necessary information to create a Picture object, and returns a new instance of that object.
Enter picture name:
Enter dpi:
Enter aing:
Picture added:
Your main script (main.py) will simulate a media library, where you store all media objects in a single list. To interact with it you should have a menu that allows the user to perform the following actions:
• Display all items in the media library, one per line in the format «type»: «string_of_object»
• Display only the song objects, one per line in the format «type»: «string_of_object»
• Display only the movie objects, one per line in the format «type»: «string_of_object»
• Display only the Picture objects, one per line in the format «type»: «string_of_object»
• Play a song Asks the user to enter the name of the song as Enter name of the song to play:. If the song is found play d If not display no such song in the media library
• Play a movie: Asks the user to enter the name of the movie as Enter name of the movie to play:. If the movie is found May it. If not display no such movie in the media library
• Display a Picture: Asks the user to enter the named the Picture as Enter name of the picture to show:. If the Picture is found display it. If not, display no such picture in the media library
• Add a song. You will then be prompted to enter a song title, an artist, and a rating as outlined in the class description.
• Add a movie. You will then be prompted to enter a the movie name, director, running time, and rating, as outlined in the class description.
• Add a Picture. You will then be prompted to enter a photo name, resolution, and rating as outlined in the class description.
• Quit the program.
You will need a loop to show and process the menu until the user chooses to quit/exit the program. This menu looks like:
*** Media Library ***
a. Display all Media
b. Display only Songs
c. Display only Movies
d. Display only Pictures
e. Play a Song
f. Play a Movie
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme