In this programming assignment you will write a program that uses two classes. When you are finished you should have five files: main.cpp, book.h, book.cpp, library.h, and library.cpp. Your class declarations should go in your .h files and your implementation should go in your .cpp files. The following is a summarization of the two classes and your main.cpp.
Before writing your code, you should make a UML class diagram for the book and library classes.
The book class will have five attributes: ISBN, title, author, and check out status. The class should have a constructor that takes parameters for ISBN, title, author first name, and author last name (you should keep these in separate fields since you will eventually need to sort the books by author last name). By default, a book should not be checked out when created. You should have getters for each attribute and a setter for the checked out status. Make sure that you place your class declaration in book.h and all the implementation code in book.cpp.
The library class will include a vector of books (from the book class above). The class should have the following methods each doing as described:
You should have two constructors for the library class:
The function main.cpp will be provided for you. You should not need to make any modifications to this function. What
A possible sample run will look as follows:
Main Menu
1. Print Book List
2. Check out a book
3. Check in a book
4. Add a book
5. Quit
Enter your choice (1-5): 1
Author Name Book Title ISBN Availability
-------------------------------------------------------------------------------------
Gookin, Dan C for Dummies, Volume 1 1878058789 In
Griggiths, David Head First C 1449399916 In
Jones, Bradley C Programming in One Hour a Day 0789751992 In
Kalicharan, Noel C Programming - An Advanced Course 1438275579 In
Kernighan, Brian The C Programming Language 0131103628 In
King, K C Programming: A Modern Approach 0393979504 In
Kochan, Stephen Programming in C 0672326663 In
Linden, Peter Expert C Programming: Deep C Secrets 0131774298 In
McGrath, Mike C Programming in Easy Steps 1840785446 In
Oualline, Steve Practical C Programming 1565923065 In
Perry, Greg C Programming Absolute Beginners Guide 0789751984 In
Perry, Greg Absolute Beginner's Guide to C 0672305100 In
Prata, Stephen C Primer Plus 0321928423 In
Reese, Richard Understanding and Using C Pointers 1449344186 In
--------------------------------------------------------------------------------------
Press any key to continue . . .
Main Menu
1. Print Book List
2. Check out a book
3. Check in a book
4. Add a book
5. Quit
Enter your choice (1-5): 2
Enter the ISBN of the book to ckeck out: 1878058789
Check out successful
Press any key to continue . . .
Main Menu
1. Print Book List
2. Check out a book
3. Check in a book
4. Add a book
5. Quit
Enter your choice (1-5): 2
Enter the ISBN of the book to ckeck out: 123456
123456 not found
Press any key to continue . . .
Main Menu
1. Print Book List
2. Check out a book
3. Check in a book
4. Add a book
5. Quit
Enter your choice (1-5): 1
Author Name Book Title ISBN Availability
-------------------------------------------------------------------------------------
Gookin, Dan C for Dummies, Volume 1 1878058789 Out
Griggiths, David Head First C 1449399916 In
Jones, Bradley C Programming in One Hour a Day 0789751992 In
Kalicharan, Noel C Programming - An Advanced Course 1438275579 In
Kernighan, Brian The C Programming Language 0131103628 In
King, K C Programming: A Modern Approach 0393979504 In
Kochan, Stephen Programming in C 0672326663 In
Linden, Peter Expert C Programming: Deep C Secrets 0131774298 In
McGrath, Mike C Programming in Easy Steps 1840785446 In
Oualline, Steve Practical C Programming 1565923065 In
Perry, Greg C Programming Absolute Beginners Guide 0789751984 In
Perry, Greg Absolute Beginner's Guide to C 0672305100 In
Prata, Stephen C Primer Plus 0321928423 In
Reese, Richard Understanding and Using C Pointers 1449344186 In
--------------------------------------------------------------------------------------
Press any key to continue . . .
Main Menu
1. Print Book List
2. Check out a book
3. Check in a book
4. Add a book
5. Quit
Enter your choice (1-5): 4
Enter the ISBN of the book: 1111111111
Enter the last name of the author: Seuss
Enter the first name of the author: Doctor
Enter the title of the book: Green Eggs and Ham
Press any key to continue . . .
Main Menu
1. Print Book List
2. Check out a book
3. Check in a book
4. Add a book
5. Quit
Enter your choice (1-5): 1
Author Name Book Title ISBN Availability
-------------------------------------------------------------------------------------
Gookin, Dan C for Dummies, Volume 1 1878058789 Out
Griggiths, David Head First C 1449399916 In
Jones, Bradley C Programming in One Hour a Day 0789751992 In
Kalicharan, Noel C Programming - An Advanced Course 1438275579 In
Kernighan, Brian The C Programming Language 0131103628 In
King, K C Programming: A Modern Approach 0393979504 In
Kochan, Stephen Programming in C 0672326663 In
Linden, Peter Expert C Programming: Deep C Secrets 0131774298 In
McGrath, Mike C Programming in Easy Steps 1840785446 In
Oualline, Steve Practical C Programming 1565923065 In
Perry, Greg C Programming Absolute Beginners Guide 0789751984 In
Perry, Greg Absolute Beginner's Guide to C 0672305100 In
Prata, Stephen C Primer Plus 0321928423 In
Reese, Richard Understanding and Using C Pointers 1449344186 In
Seuss, Doctor Green Eggs and Ham 1111111111 In
--------------------------------------------------------------------------------------
Press any key to continue . . .
Main Menu
1. Print Book List
2. Check out a book
3. Check in a book
4. Add a book
5. Quit
Enter your choice (1-5): 3
Enter the ISBN of the book to check in: 1878058789
Check in successful
Press any key to continue . . .
Main Menu
1. Print Book List
2. Check out a book
3. Check in a book
4. Add a book
5. Quit
Enter your choice (1-5): 1
Author Name Book Title ISBN Availability
-------------------------------------------------------------------------------------
Gookin, Dan C for Dummies, Volume 1 1878058789 In
Griggiths, David Head First C 1449399916 In
Jones, Bradley C Programming in One Hour a Day 0789751992 In
Kalicharan, Noel C Programming - An Advanced Course 1438275579 In
Kernighan, Brian The C Programming Language 0131103628 In
King, K C Programming: A Modern Approach 0393979504 In
Kochan, Stephen Programming in C 0672326663 In
Linden, Peter Expert C Programming: Deep C Secrets 0131774298 In
McGrath, Mike C Programming in Easy Steps 1840785446 In
Oualline, Steve Practical C Programming 1565923065 In
Perry, Greg C Programming Absolute Beginners Guide 0789751984 In
Perry, Greg Absolute Beginner's Guide to C 0672305100 In
Prata, Stephen C Primer Plus 0321928423 In
Reese, Richard Understanding and Using C Pointers 1449344186 In
Seuss, Doctor Green Eggs and Ham 1111111111 In
--------------------------------------------------------------------------------------
Press any key to continue . . .