Classic Store is a book store downtown that has been selling books in the town for a very long time and is quite known in the neighborhood. They have recently moved to digitalize their records onto the system. They need to add all the book details into the new system. Help the authorities to collect the book details and to display them using C++ programming. Use the concept of Constructors to create Book objects. Store the book details in an array and display the array in a table format. Write a C++ program to store the book details in an array as an array of Book objects and display them using constructors. Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement. A class named Book has the following private data member variables. Data type Member Name int id string title string category string author double price   Define the following pubic member function in the Book class Member Function Description void display(Book bookArray[], int size) This method is used to display the book details of each book in the bookArray. In the main method, obtain input from the user in the console and call the display function to display the details. Refer to sample input and output for formatting specifications.  [All text in bold corresponds to input and rest corresponds to output] Sample Input and Output 1: Enter the number of books 2 Enter book 1 details Enter the Book ID 1001 Enter the title Harry Potter Enter the category Fiction Enter the author J K Rowling Enter the price 999 Enter book 2 details Enter the Book ID 1002 Enter the title Bhagavath Geeta Enter the category Mythology Enter the author Ganesh Enter the price 1600 Book ID     Title     Category     Author     Price     1001    Harry Potter    Fiction    J K Rowling    999 1002    Bhagavath Geeta    Mythology    Ganesh    1600   --------ADDITIONAL TEST CASES ATTACHED KINDLY CHECK THAT ALSO-------------

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter19: Probabilistic Dynamic Programming
Section19.4: Further Examples Of Probabilistic Dynamic Programming Formulations
Problem 7P
icon
Related questions
Question

SOLUTION TO BELOW PROBLEM NEEDED URGENTLY PLEASE.

-------------------------------------------------------------------------

Classic Store is a book store downtown that has been selling books in the town for a very long time and is quite known in the neighborhood. They have recently moved to digitalize their records onto the system. They need to add all the book details into the new system. Help the authorities to collect the book details and to display them using C++ programming. Use the concept of Constructors to create Book objects. Store the book details in an array and display the array in a table format.

Write a C++ program to store the book details in an array as an array of Book objects and display them using constructors.

Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.

A class named Book has the following private data member variables.

Data type Member Name
int id
string title
string category
string author
double price

 

Define the following pubic member function in the Book class

Member Function Description
void display(Book bookArray[], int size) This method is used to display the book details of each book in the bookArray.


In the main method, obtain input from the user in the console and call the display function to display the details.

Refer to sample input and output for formatting specifications. 

[All text in bold corresponds to input and rest corresponds to output]
Sample Input and Output 1:

Enter the number of books
2
Enter book 1 details
Enter the Book ID
1001
Enter the title
Harry Potter
Enter the category
Fiction
Enter the author
J K Rowling
Enter the price
999
Enter book 2 details
Enter the Book ID
1002
Enter the title
Bhagavath Geeta
Enter the category
Mythology
Enter the author
Ganesh
Enter the price
1600
Book ID     Title     Category     Author     Price    
1001    Harry Potter    Fiction    J K Rowling    999
1002    Bhagavath Geeta    Mythology    Ganesh    1600

 

--------ADDITIONAL TEST CASES ATTACHED KINDLY CHECK THAT ALSO-------------

 

 

Additional Sample TestCases
Sample Input and Output 1:
Enter the number of books
2
Enter book 1 details
Enter the Book ID
1001
Enter the title
Harry Potter
Enter the category
Fiction
Enter the author
JK Rowling
Enter the price
999
Enter book 2 details
Enter the Book ID
1002
Enter the title
Bhagavath Geeta
Enter the category
Mythology
Enter the author
Ganesh
Enter the price
1600
Book ID
Title
Category
Author Price
1001
Harry Potter
Fiction J K Rowling
1002
Bhagavath Geeta Mythology
Ganesh
Sample Input and Output 2:
Enter the number of books
Enter book 1 details
Enter the Book ID
1010
Enter the title
The Art of War
Enter the category
Treatise
Enter the author
Sun Tzu
Enter the price
1966
Book ID
Title
Author
Price
Category
The Art of War Treatise
1010
Sun Tzu
Transcribed Image Text:Additional Sample TestCases Sample Input and Output 1: Enter the number of books 2 Enter book 1 details Enter the Book ID 1001 Enter the title Harry Potter Enter the category Fiction Enter the author JK Rowling Enter the price 999 Enter book 2 details Enter the Book ID 1002 Enter the title Bhagavath Geeta Enter the category Mythology Enter the author Ganesh Enter the price 1600 Book ID Title Category Author Price 1001 Harry Potter Fiction J K Rowling 1002 Bhagavath Geeta Mythology Ganesh Sample Input and Output 2: Enter the number of books Enter book 1 details Enter the Book ID 1010 Enter the title The Art of War Enter the category Treatise Enter the author Sun Tzu Enter the price 1966 Book ID Title Author Price Category The Art of War Treatise 1010 Sun Tzu
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole