-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibro.h
49 lines (42 loc) · 1.12 KB
/
Libro.h
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
45
46
47
48
49
#include<iostream>
using namespace std;
class Libro : public Material
{
private:
int numPag;
string Autor;
public:
Libro();
Libro(int _idMaterial,string _titulo,int _numPag,string _Autor);
//Metodos Get
int getNumPag(){return numPag;};
string getAutor(){return Autor;};
//Metodos Set
void setNumPag(int _numPag){numPag=_numPag;};
void setAutor(string _Autor){Autor=_Autor;};
//Metodos abstractos
void muestraDatos();
int cantidadDiasPrestamo();
};
Libro::Libro():Material()
{
numPag=1;
Autor="Unknown";
}
Libro::Libro(int _idMaterial,string _titulo,int _numPag,string _Autor):Material( _idMaterial, _titulo)
{
numPag=_numPag;
Autor=_Autor;
}
void Libro::muestraDatos()
{
cout<< "\n--------Datos del Libro---------\n\n";
cout<< "ID: "<<Material::idMaterial<<endl;
cout<< "Titulo: "<<Material::titulo<<endl;
cout<< "Número de Páginas: " << numPag<<endl;
cout<< "Autor: " << Autor << endl;
}
int Libro::cantidadDiasPrestamo()
{
return 7;
}