[Solved]Write C Program Include Library Q37251165
Write a C++ program.
Do not include any library other than <iostream>,<iomanip>, <fstream> and or <cmath>



Q2. Library borrowing system In this question, you are required to implement a simple library borrowing system by finishing the following tasks: 1. Accept the information about the book, including the book name, subject, price, and status. The status records whether the book is available for borrowing List all the books and their corresponding information. The books should be sorted by the price in ascending order. If two books has identical price, sort them by their name in ascending order. There are only three subject categories in this library, including Art, English, and Science. Accept the input from the user. There are three kinds of tasks: 2. 3. Borrow +the name of book: the user wants to borrow the book with the input name. If the book is unavailable, print a message and ask the user to input again. Return+the name of a book: the user wants to return the book he borrowed before. Assume the user always returns the book that is unavailable. Exit: exit the library borrowing system o Notes: 1. The concept of book should be implemented as a C++ class. 2. Status of the book should be changed after a user borrows it. 3. All the data and the function that change the data should be private. 4. The form of name in a book object is “book” + an integer. When sorting, you need to compare the name of two objects by the integer rather than directly comparing the two strings, e.g. “bookl1”> “book2” rather than “book1l” < “book2”. 5. The input will contain the amount of the books first. Use dynamic array to store them, and delete the array before the program terminates. Expected Outcomes Input the number of books: Input the information of books (name, subject, price, status): bookl Art 200 0 book2 English 150 0 book3 Art 300 1 book4 Science 100 1 book5 Art 220 0 book6 Science 290 1 book7 Art 380 0 book8 Science 3201 book9 English 120 0 Current books: book4 Science 100 1 book9 English 120 (0 book2 English 150 (0 bookl Art 200 0 book5 Art 220 0 book6 Science 290 1 book3 Art 300 1 book8 Science 320 1 book7 Art 380 0 Input the instruction: Borrow bookl Sorry, the book is not available. Try again. Input the instruction: Borrow book3 Succeed! Input the instruction: Return book3 Thanks for using our services! Input the instruction: Exit See you again! Show transcribed image text Q2. Library borrowing system In this question, you are required to implement a simple library borrowing system by finishing the following tasks: 1. Accept the information about the book, including the book name, subject, price, and status. The status records whether the book is available for borrowing List all the books and their corresponding information. The books should be sorted by the price in ascending order. If two books has identical price, sort them by their name in ascending order. There are only three subject categories in this library, including Art, English, and Science. Accept the input from the user. There are three kinds of tasks: 2. 3. Borrow +the name of book: the user wants to borrow the book with the input name. If the book is unavailable, print a message and ask the user to input again. Return+the name of a book: the user wants to return the book he borrowed before. Assume the user always returns the book that is unavailable. Exit: exit the library borrowing system o Notes: 1. The concept of book should be implemented as a C++ class. 2. Status of the book should be changed after a user borrows it. 3. All the data and the function that change the data should be private. 4. The form of name in a book object is “book” + an integer. When sorting, you need to compare the name of two objects by the integer rather than directly comparing the two strings, e.g. “bookl1”> “book2” rather than “book1l”
Expert Answer
Answer to Write a C++ program. Do not include any library other than , , and or … . . .
OR

