Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started