-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.cpp
More file actions
41 lines (30 loc) · 861 Bytes
/
Copy pathBook.cpp
File metadata and controls
41 lines (30 loc) · 861 Bytes
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
//
// Created by marin on 12/12/17.
//
#include "Book.h"
int compteur_book=0;
Book::Book(string author, string title, string editor, string isbn, Target target, bool state){
this->author=author;
this->title=title;
this->editor=editor;
this->isbn=isbn;
this->target=target;
this->state=state;
++compteur_book;
this->book_id=compteur_book;
this->lib_id=0;
}
string Book::detarget() {
string table[]={"Tous","Jeunesse","Feminin","Masculin"};
return table[target];
}
void Book::affiche() {
cout<<"auteur :"<<author<<" titre :"<<title<<" public :"<<detarget()<<
" état"<<state<<" book_id= "<<book_id <<"Possédé par librairie "<<lib_id<<endl;
}
void Book::is_available() {
if(state==1)
cout<<"le livre est disponible"<<endl;
else
cout<<"le livre est indisponible"<<endl;
}