1·The project should be submitted using the Blackboard. 2. Include all files in
ID: 3708774 • Letter: 1
Question
1·The project should be submitted using the Blackboard. 2. Include all files in one folder and compress your folder using (zip) not rar. 3. Includes al the following files in one folder: A. The code and the files necessary to compile and test the project B. Test Plan: Showing how you tested the program (show the steps of your testing procedure along with screen shots). (10 points) C. A short description of the design plan and general comments. (5 points) Final Project: Write a C++ program to manage a library system. The main user is the librarian Build Specifications (35 points) 1. The system should load a catalog of books, journals, and magazines at the start of the program. (at least five of each) 2. A user can search the catalog: The user of the system can search the library's catalog by using the name of the item. Also, a user can list books by category (Book, Journal, or magazine) If you are looking specifically for a book, you can search by the name of the author. 3. A user can check out books, journals, or magazines: The user needs to find the iterm first, then they can check it out. A user cannot check out an item that is already checked out 4. A user can return books, journals, or magazines: A user can returm an item. The user needs to find the item first, then they can returm it 5. Add new books, journals, or magazines to the catalog. A librarian can add a new item to the catalogExplanation / Answer
#include<iostream>
#include<string>
#include<vector>
using namespace std;
class LibraryItem
{
private:
string name;
bool checkedOut;
public:
LibraryItem()
{
checkedOut=false;
}
LibraryItem(string _name)
{
LibraryItem();
name=_name;
}
string getName()
{
return name;
}
bool getCheckedoutStatus()
{
return checkedOut;
}
virtual string getSpecialAttribute()
{
return "";
}
};
class Book:public LibraryItem
{
private:
string authorName;
public:
Book(string _bookname,string _authorName):LibraryItem(_bookname)
{
authorName=_authorName;
}
string getSpecialAttribute()
{
return authorName;
}
};
class Journal:public LibraryItem
{
private:
string volume;
public:
string getSpecialAttribute()
{
return volume;
}
};
class Magazine:public LibraryItem
{
private:
string issueNumber;
public:
string getSpecialAttribute()
{
return issueNumber;
}
};
int main()
{
//vector<LibraryItem*> items;
Book book1("Introduction to Maya","Stephen Hawking");
LibraryItem *items;
//items.push_back(book1);
items=&book1;
cout<<"Name:"<<items->getName()<<" Author:"<<items->getSpecialAttribute()<<endl;
if(items->getCheckedoutStatus())
{
cout<<"CheckedOut";
}
else
{
cout<<"Not Checked Out";
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.