So I'm at a loss for my current assignment. I've missed some classes and so I've lost my knowledge on how to go about it but basically the problem is this.
Create a base class Music, a class Genre derived from Music, and a class Performer derived from Genre. Class Music only has a string title, Genre adds string type and Performer has string name.
Interview the user for their favorite artist, their genre and title of the music they like best. Then call a Performer class display function that shows all the information. Inheritance must be used.
I'm not sure how to even start this as I said I am behind and have forgotten a lot. If I could get help on even just a dummy way to make the class and then call it for the interview I would be greatful
Sorry I've lost my knowledge of much of the vocab as well so I'm not sure what you mean. Basically I want to have it so that it asks the genre and music individually and asks the user for the input instead of a pre created lists. Not sure if that answered your question or not.
So here is what I have for the main function of these classes.
1 2 3 4 5 6 7 8 9 10
int main()
{
Genre("What is your favorite genre of music?");
cout<<endl;
Music("Who is your favorite musician in that genre?");
cout<<endl;
Performer.display();
return 0;
}
I am not sure how to call classes or display them or anything, someone please help.
You don't "call" classes: classes only describe things - e.g., class Genre only describes what a Genre is. It's the job of an object or instance of class Genre which represents a particular Genre, for example, an instance of Genre named rock should represent specifically Rock and Roll.
the interview...
If you're going to be discussing the problem, I would consider mentioning that the problem specification implies that a Performer is a Genre (inheritance implies that a subclass is-a base class.) This is nonsense at worst, or at least counter-intuitive.
what does the
system("pause");
part mean as I'm not sure how to implement it. Also how do I use the class in a way that it asks the user for the title and genre? Would it be a simple cin or something else?