-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOOP-biblio.cc
44 lines (40 loc) · 929 Bytes
/
OOP-biblio.cc
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
44
#include <iostream>
#include <vector>
#include <string>
using namespace std;
/*******************************************
* Completez le programme a partir d'ici.
*******************************************/
class Auteur
{
public:
string getNom(){
return nom;
}
string getPrix(){
return prime;
}
Auteur(string nom,bool prime = false): nom(nom),prime(prime){}
private:
string nom;
bool prime;
}
class Oeuvre
{
public:
Oeuvre(string titre,string& auteur,string& langue): titre(titre),auteur(auteur),langue(langue) {}
string getTitre(){ return titre; }
string getAuteur(){return auteur;}
string getLangue(){return langue;}
void affiche() {
cout << titre <<", "<<auteur<<", en "<<langue<<endl;
}
~Oeuvre(){
cout << "L'oeuvre \""<<titre <<", "<<auteur<<", en "<<langue<<"\" n'est plus disponible." << endl;
}
Oeuvre(Oeuvre const &autreOeuvre)
private:
string titre;
string& auteur;
string& langue;
}