Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ If you are asked to write three classes : class Person, BookAuthor, and Book. The class Person involves with a person's identity. The class

C++

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

If you are asked to write three classes : class Person, BookAuthor, and Book. The class Person involves with a person's identity. The class BookAuthor involves with a collection of books or book titles. The class Book involves 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 two private data members. Try not to use too many member functions due to the time you have. See the grading criteria what you will be assessed on. You are allowed to use one file for the classes, implementations, and the main(). If using separate files, you will earn 2 extra points. Below is the main() which will give you a good clue on developing your classes: INC { Book Cplusbk("Tony Gaddis", "C++ Early Object" , 2013, 57.8, 500); // (Author's name, year published, price, and number of books in stock) Cplusbk.Display(); // displays the Author's name, title, year published, price, and number of books in stock. Book bk1(50.0), bk2(80.0), bk3; // The following line with its question is worth 2 points if your answer is correct. 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; } Grading criteria: (syntax errors are moderately ok) Appropriate data types: 2 points Constructors are constructed and logical : 4 points Appropriate class relationships: 4 points The program logic is good/logical: 4 points Answer to the question: 2 points Question 1 16 pts If you are asked to write three classes : class Person, BookAuthor, and Book. The class Person involves with a person's identity. The class BookAuthor involves with a collection of books or book titles. The class Book involves 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 two private data members. Try not to use too many member functions due to the time you have. See the grading criteria what you will be assessed on. You are allowed to use one file for the classes, implementations, and the main(). If using separate files, you will earn 2 extra points. Below 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, year published, price, and number of books in stock) Cplusbk.Display(); // displays the Author's name, title, year published, price, and number of books in stock. Book bk1(50.0), bk2(80.0), bk3; // The following line with its question is worth 2 points if your answer is correct. 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; } Grading criteria: (syntax errors are moderately ok) Appropriate data types: 2 points Constructors are constructed and logical : 4 points Appropriate class relationships: 4 points The program logic is good/logical: 4 points Answer to the question: 2 points

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions