![]() |
Главная Случайная страница Контакты | Мы поможем в написании вашей работы! | |
|
#include <iostream>
#include <conio.h>
Using namespace std;
// Объявление класса CBook
#include <string>
Class CBook
{ private:
string m_author; // автор
string m_title; // название
int m_year; // год издания
public:
CBook();
CBook (const string&, const string&, int);
~CBook();
// методы установки значений
void setAuthor(const string &);
void setTitle (const string &);
Void setYear(const int);
// методы возврата значений
string getAuthor() const {return m_author;}
string getTitle() const {return m_title;}
int getYear() const {return m_year;}
// метод проверки названия книги
bool check (const string&) const;
};
// Определение методов класса CBook
CBook::CBook():m_year(0), m_title(""), m_author(""){}
CBook::CBook(const string& author, const string& title,int year): m_year(year), m_title(title), m_author(author){}
CBook::~CBook(){}
// установить автора
void CBook::setAuthor(const string& author)
{m_author = author;}
// установить название
void CBook::setTitle(const string& title)
{m_title = title;}
// установить год издания
void CBook::setYear(const int year)
{m_year = year;}
// проверка книги по названию
bool CBook::check(const string& key) const
{ if (m_title == key)
Return true;
Return false;
}
//Объявление класса меню CCatalogue
static const int MAX_SIZE = 100;
Дата публикования: 2015-04-07; Прочитано: 169 | Нарушение авторского права страницы | Мы поможем в написании вашей работы!