Question: Im needing help with a c++ programming challenge please. Thank you. write three classes : class Person, BookAuthor, and Book. The class Person involves with
Im needing help with a c++ programming challenge please. Thank you.
write three classes : class Person, BookAuthor, and Book. The class Person involves with a person's identity. The class BookAuthor involves a collection of books or book titles. The class Book involves the number of books in stock , book title, and price.
Design the three classes . The classes must use appropriate relationships.
Each class must have two constructors, one is the default and the other is an overloaded constructor.
Each class has at least one private data member.
You are allowed to use one program file for the classes, implementations, and the main(). Use separate files.
Here is the main( ) which will give you a good clue on developing your classes:
int main( )
{ Book Cplusbk("Tony Gaddis", "C++ Early Object" , 2013, 57.8, 500); // Author's name,
//title, year published, price, and the number of books in stock).
Cplusbk.Display( ); // displays the Author 's name, Author's
//name, title, year published, price, and number of books in stock.
// The following line with its question is worth 2 points if your answer is correct.
Book bk1(50.0), bk2(80.0), bk3;
bk3 = bk1 + bk2; // As a result, bk3 contains 130.0 as its price.
Question:
What do you need to declare in the class and define to accomplish the bk3 = bk1+bk2; successfully?
return 0;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
