Question: Write a C + + program that that creates a class Book that has the following private attributes: ID ( int ) , title (
Write a C program that that creates a class Book that has the following private attributes: ID int title string price float and author string The class should contain public functions including all the required getter eg getID and setter eg se ID functions. Also, include a displayBookInfo function that displays the book information:
void setIDint id to set the ID value
void setTitle string title to set the title value
void setPricefloat price to set the price value
void setAuthorstring author to set the author value
int getID to get the ID value
string getTitle to get the title value
float getPrice to get the price value
string getAuthor to get the author value
void displayBookInfo to display the book info as: "The book ID is title is xxx price is and author is yyy using the getter functions eg getID
Then, use the Book class to write a C program for an ebook system. Your program should include ways for customers to buy a new book and view their list of purchased books.
Here are the steps:
a Create an array that can hold books
b Write a dowhile loop that displays a menu to the user:
i Purchase a new book: if there are less than books, let the user type in the book information.
If there are already books, let the user know and continue the loop
ii Display all purchased books: display all purchased books
iii. Exit: terminate the loop
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
