Question: Write a C + + program that defines a class called Book. The Book class should have the following private members: A string member variable

Write a C++ program that defines a class called "Book". The Book class should have the following private members:
A string member variable for the book's title.
A string member variable for the book's author.
An integer member variable for the book's publication year.
The Book class should have a constructor that takes three parameters: a string for the title, a string for the author, and an integer for the publication year. This constructor should initialize the member variables with the values passed to it.
Additionally, the Book class should have a function named "displayInfo()" that prints out the book's title, author, and publication year.
 Write a C++ program that defines a class called "Book". The

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!