Question: Using C++ please Define the following classes based on the information below. Make any assumptions as necessary in terms of data types if not specified.
Using C++ please

Define the following classes based on the information below. Make any assumptions as necessary in terms of data types if not specified. 1. Media class has a private variable title and a public function getTitle 2. Media class has a pure virtual function called play that does not take any arguments or return any value 3. Video class is a subclass of Media class. Audio class is a subclass of Media class 4. Video class has a private variable resolution. Audio class has a private variable genre 5. Both Video and Audio class implement the play function 6. For Video class, when play is called it prints "Playing __title__with resolution __resolution__" The "__" in the above line indicates a variable that should have the correct value when printed 7. For Audio class, when play is called it prints "Playing __title__ from genre -genre_." 8. The testMedia function below can be compiled and executed and produces the output as given void testMedia() { Media *vp = new Video ("Star Wars", 1440); Media *ap = new Audio("Seagulls", "comedy"); vp->play(); ap->play(); delete vp; delete ap; } Output: Playing Star Wars with resolution 1440 Playing Seagulls from genre comedy
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
