Question

MEDIA INHERITANCE - C++ You will create an inheritance set of classes. Use proper rules for...

MEDIA INHERITANCE - C++ You will create an inheritance set of classes. Use proper rules for data types, class definitions, and inheritance (check input/output of data below). You will create a super media class that will define a general form of media. A media properties will consist of the name and price. The media should be able to construct itself out of the arguments sent to it, virtually print both data fields labeled (price to two decimal places) and overload the < operator to compare two medias by comparing their name field. You will then create two subclasses of media for a movie and a book. A movie "is a" media, but also has a rating. It also should construct itself by initializing all data fields, but use the super media constructor to initialize the inherited data fields. It will also override the media print function. In the new version, it should print that it is a movie, then call the super print function to print the name and price, then print the new labeled rating data field itself. A book "is a" media, but also has an author and will be set up similar to a movie. It also should override the media print function. In the new version, it should print that it is a book, then call the super print function to print the name and price, then print the new labeled author data field itself. You will then create a main class that will declare an array of three super media pointers (so you can combine movies and books together in the array). Then using a loop, prompt and input all the data fields (asking the user what kind of media for what added data to input). At the end of the loop, construct the next (proper type) object and assign it into the array. Put a blank line between prompts for the input objects. When the input loop is over, call a function in the main program that will selection sort the array of media pointers. Use the overloaded < operator to perform the sort on the name field of the calling object. In a separate loop, call the print function (with dynamic binding!). Put a blank line between output objects. Run your program with the data below and create the output as shown below. Submit your three class definitions, main program, and output text file. Document all files with at least 4 lines of comments at the top and at least 5 comments throughout the code for all of the not easily understandable lines of code. MEDIA INHERITANCE - DATA Input: Enter name: Planet of the Apes Enter price: 8.90 Is media a book(b) or movie(m): m Enter rating: G Enter name: Back to the Future Enter price: 13.90 Is media a book(b) or movie(m): m Enter rating: PG Enter name: Intensity Enter price: 7.90 Is media a book(b) or movie(m): b Enter author: Dean Koontz Output: Movie Name is Back to the Future Price is 13.90 Rating is PG Book Name is Intensity Price is 7.90 Author is Dean Koontz Movie Name is Planet of the Apes Price is 8.90 Rating is G

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
MEDIA INHERITANCE - C++ You will create an inheritance set of classes. Use proper rules for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • C++ program Correctly complete the following assignment. Follow all directions. The main purpose is to show...

    C++ program Correctly complete the following assignment. Follow all directions. The main purpose is to show super and sub class relationships with an array of super media pointers to sub class objects and dynamic binding. The < operator will be overloaded in the super class so all subclasses can use it. The selection sort method will be in the main .cpp file because it will sort the array created in main. The final .cpp file, the three .h header class...

  • FOR JAVA: Summary: Create a program that stores info on textbooks. The solution should be named...

    FOR JAVA: Summary: Create a program that stores info on textbooks. The solution should be named TextBookSort.java. Include these steps: Create a class titled TextBook that contains fields for the author, title, page count, ISBN, and price. This TextBook class will also provide setter and getter methods for all fields. Save this class in a file titled TextBook.java. Create a class titled TextBookSort with an array that holds 5 instances of the TextBook class, filled without prompting the user for...

  • Using C++ Skills Required Create and use classes Exception Handling, Read and write files, work vectors....

    Using C++ Skills Required Create and use classes Exception Handling, Read and write files, work vectors. Create Functions, include headers and other files, Loops(while, for), conditional(if, switch), datatypes,  etc. Assignment You work at the computer science library, and your boss just bought a bunch of new books for the library! All of the new books need to be cataloged and sorted back on the shelf. You don’t need to keep track of which customer has the book or not, just whether...

  • MUST BE WRITTEN IN C++ Objective: Learn how to define structures and classes, create and access...

    MUST BE WRITTEN IN C++ Objective: Learn how to define structures and classes, create and access a vector of structures, use sort with different compare functions. Assignment: Your program will use the same input file, but you will print the whole book information, not just the title. And, most importantly, this time you will take an object oriented approach to this problem. Detailed specifications: Define a class named Collection, in which you will define a structure that can hold book...

  • MUST BE WRITTEN IN C++ Objective: Learn how to define structures and classes, create and access...

    MUST BE WRITTEN IN C++ Objective: Learn how to define structures and classes, create and access a vector of structures, use sort with different compare functions. Assignment: Your program will use the same input file, but you will print the whole book information, not just the title. And, most importantly, this time you will take an object oriented approach to this problem. Detailed specifications: Define a class named Collection, in which you will define a structure that can hold book...

  • Instructions: Written in English (Basic Language) Modify the Base Project Sample Code to create a database...

    Instructions: Written in English (Basic Language) Modify the Base Project Sample Code to create a database of your own design that includes at least four data fields. The overall design and format of your program is up to you. Your program should implement the following menu options – A. Add Item B. List All Items C. Quit Any data theme or motif is acceptable, provided your project has at least four data elements. Please make sure your data structure implements...

  • Part 1 The purpose of this part of the assignment is to give you practice in...

    Part 1 The purpose of this part of the assignment is to give you practice in creating a class. You will develop a program that creates a class for a book. The main program will simply test this class. The class will have the following data members: A string for the name of the author A string for the book title A long integer for the ISBN The class will have the following member functions (details about each one are...

  • ONLY NEED THE DRIVER CLASS PLEASE!!! Domain & Comparator Classes: 0.) Design a hierarchy of classes,...

    ONLY NEED THE DRIVER CLASS PLEASE!!! Domain & Comparator Classes: 0.) Design a hierarchy of classes, where the Media superclass has the artistName and the mediaName as the common attributes. Create a subclass called CDMedia that has the additional arrayList of String objects containing the songs per album. Create another subclass called DVDMedia that has the additional year the movie came out, and an arrayList of co-stars for the movie. 1.) The superclass Media will implement Comparable, and will define...

  • // C programming Create a system managing a mini library system. Every book corresponds to a...

    // C programming Create a system managing a mini library system. Every book corresponds to a record (line) in a text file named "mylibrary.txt". Each record consists of 6 fields (Book ID, Title, Author, Possession, checked out Date, Due Date) separated by comma: No comma '', "in title or author name. This mini library keeps the record for each book in the library. Different books can share the book "Title". But the "Book ID" for each book is unique. One...

  • Please help code in c++ and use the answers you get from question 1 and 2...

    Please help code in c++ and use the answers you get from question 1 and 2 into the 3rd answer! Question 1 is first, question 2 is in the middle, question 3 is last Input Array (10 pts) te a function only (no main) that takes an array of doubles as a parameter as well as another integer rray. Create a for loop that asks the user to input any real number between-100 and r each element of the array....

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT