class Sale{
private:
float total_sale;
int total_books_bought;
public:
set_totalSale(float);
set totalBook(int);
//getters
}
class Book{
string bookTitle;
int copies;
public:
set_title(string)
set_copies_(int);
//getters
void addcopies(int);
void decreasecopies(int);
}
class Member{
string memID;
float total_paid;
int total_books_bought;
public:
//setters and getters
}
I am to relate these classes in association to store every sale to a member or a non-member....
I wrote so many lines of code but not working....really frustrated
uhm... I have no idea what Aceix is trying to say... :D But. If you want them to interact with eachother, you have to use Inheritance. That allows you to then use polymorphism and other good stuff. You can easily google and learn what this is ,you can check the tutorials on this website, or you can watch youtube videos of people explaining things, which is what I prefer.
Video 52: Inheritance.
Video 55-57 : Poly, Virtual Functions, Pure Virtual Functions.
There are also video of composition which you should check out. There are also other youtubers who explain things in a good way. I recommend checking out CodingMadeEasy's youtube channel, playlist is called C++ Made Easy.
hmm No, no you did not say that in any way shape or form. You literally just copy pasted his class, like that was gonna do any difference. Just becuase it made sense in your head, doesnt mean it makes sense in others.