subject
Computers and Technology, 04.06.2020 13:14 gacyber

Class Book represents information about any textbook and has two attributes: Title and Author, where Title [String] is the book title (e. g. “Computer Organization and Architecture”) and author is an object of class Author which includes author’s name (e. g. “William Stallings”), Author-ID, Employer Name. Author class inherits class Person which includes First Name, Last Name, SSN, Gender. Note that any string variable is variable length. So you need to use dynamic memory.

PART1

(a) Define class Book including all necessary data members and access member functions. (2pts)

(b) Implement setter and getter methods for title and author. (2 pts)

(c) Implement constructor that takes required arguments (1.5 pts)

(d) Implement destructor. (1.5 pts)

(e) define a variable that can be used to store the number of active objects of the book class

(bonus 1 pt)

PART 2

(a) Define classes Author & Person including all necessary data members and access member functions. Also define the inheritance between both classes. (3 pts)

(b) Implement setter and getter for data members. (3pts)

(c) Implement Constructors & Destructors. (1pts)

(e) define a data member that can be used to store the number of active objects of the author class. (bonus 1pt)

PART3

Write main program that do the following:

Creates an object (b1) of Book and another object (a1) of Author class. (1.5pts)

Create a pointer to anonymous object of class Book (bptr). (1.5pts)

Print author first name using bptr using required functions (1.5pts)

Change employer name for a1 using required functions (1.5pts)

Implement and use the required function to insert object details of author inside object of book as follows:

b1+=a1; (Bonus 2 pts)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
If you turn on the lock alpha button , what happens
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
question
Computers and Technology, 23.06.2019 06:40
What are the three uses of a screw?
Answers: 2
question
Computers and Technology, 24.06.2019 11:30
What does the https: // mean when you type in a website
Answers: 1
You know the right answer?
Class Book represents information about any textbook and has two attributes: Title and Author, where...
Questions
question
Mathematics, 26.04.2021 23:20
question
Mathematics, 26.04.2021 23:20
question
Business, 26.04.2021 23:20
question
English, 26.04.2021 23:20
question
Mathematics, 26.04.2021 23:20
question
Mathematics, 26.04.2021 23:20
question
Mathematics, 26.04.2021 23:20