当前位置: 首页>>代码示例>>C++>>正文


C++ Book::getID方法代码示例

本文整理汇总了C++中Book::getID方法的典型用法代码示例。如果您正苦于以下问题:C++ Book::getID方法的具体用法?C++ Book::getID怎么用?C++ Book::getID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Book的用法示例。


在下文中一共展示了Book::getID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: reportCheckout

void reportCheckout(Patron p, Book b, int test)
{   /*receives a patron, book and the test value
     based on test value prints out if book is checked out to patron
     returns nothing
     */
    if (test==1)
        cout<< b.getID()<<" is checked out to "<<p.getID()<<".\n";
    else
        cout<<b.getID()<<" could not be checked out to "<< p.getID()<<".\n";
}
开发者ID:joshsarath,项目名称:Fall-13-CSC-281-Project-9,代码行数:10,代码来源:main.cpp

示例2: showBooks

void Library::showBooks() const
{
	IdentNum i;
	if (books.size()==0)
		cout << "Nao existem livros registados.\n";
	else
	{
		cout << "#### Livros ####\n";
		cout << "---------------------------------------------------------------------------- \n";
		cout << "| ID   | Titulo                        | Autor                    | Disp.  |\n";
		cout << "---------------------------------------------------------------------------- \n";
		cout << setiosflags(ios::left);
		for (i=1;i<=books.size();i++)
		{
			Book bookTemp = getBookByID(i);
			cout << "| " << setw(MAXIDLENGTH) << bookTemp.getID() << "| " << setw(MAXTITLELENGTH) << bookTemp.getTitle() << "| " << setw(MAXAUTHORLENGTH) << bookTemp.getAuthor() << "| " << setw(MAXQUANTITYLENGTH) << bookTemp.getNumAvailable() << "|\n";
		}
		cout << resetiosflags(ios::left);
		cout << "---------------------------------------------------------------------------- \n";
	}
}
开发者ID:vascofg,项目名称:prog-library,代码行数:21,代码来源:library.cpp

示例3: book_id_search

//book searching functions
void book_id_search()
{
	cout << "Enter the book's ID:" << endl;
	int id;
	cin >> id;

	Category *tmp1 = beginning;
	Book *tmp;

	system("CLS");
	cout << "Searching..." << endl;

	int i = 0;

	while (tmp1 != NULL)
	{
		tmp = tmp1->getHead();

		while (tmp != NULL)
		{
			if (tmp->getID() == id)
			{
				i++;
				tmp->print();
				book_menu(tmp);
				return;
			}
			tmp = tmp->getNext();
		}
		tmp1 = tmp1->getNext();
	}

	if (i == 0)
	{
		system("CLS");
		cout << "No such ID was found." << endl;
		cout << "Please try again" << endl;
	}
}
开发者ID:fatboc,项目名称:Biblio,代码行数:40,代码来源:search.cpp


注:本文中的Book::getID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。