1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| /* penses à utiliser les listes d'initialisation dans le constructeur (comme fait
* ici :D)
*/
Book::Book(const std::string& title, const std::string& author, std::string&
publisher, float price):title(title),author(author),publisher(publisher),
price(price
{
}
/* comme indiqué, le destructeur ne fait rien... mais j'aime autant
* l'implémenter quand meme :D
*/
Book::~Book()
{
}
void Book::show_book() const
{
std::cout<<"Titre :"<<titre<<std::endl
<<"Auteur :"<<auteur<<std::endl
<<"Editeur : "<<publisher<<std::endl
<<"Prix :"<<price<<std::endl;
}
void Book::show_title() const
{
std::cout<<"Titre :"<<title<<std::endl;
}
void Book::show_author() const
{
std::cout<<"Auteur :"<<author<<std::endl;
}
void Book::show_publisher() const
{
std::cout<<"Editeur:"<<publisher<<std::endl;
}
void Book::show_price() const
{
std::cout<<"Prix :"<<price<<std::endl;
}
void Book::modify_price(float price)
{
price=newprice;
} |
Partager