Created
November 21, 2016 22:10
-
-
Save dutchand/1325a6c96d9cae9de69ef2598980edbf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # include<iostream.h> | |
| # include<conio.h> | |
| # include<string.h> | |
| # include "Libro.h" | |
| # include "Biblioteca.h" | |
| Biblioteca::Biblioteca(){ | |
| strcpy(nombre," "); | |
| cantidad=0; | |
| for(int i=0; i<cantidad; i++) | |
| lib[i].set_libro(); | |
| } | |
| Biblioteca::Biblioteca(char nom[],int can,char tit[],char aut[],int ye){ | |
| strcpy(nombre,nom); | |
| cantidad=can; | |
| for(int i=0; i<cantidad; i++){ | |
| lib[i].set_titulo(tit); | |
| lib[i].set_autor(aut); | |
| lib[i].set_year(ye); | |
| } | |
| } | |
| void Biblioteca::set_biblioteca(char nom[],int can,char tit[],char aut[],int ye){ | |
| strcpy(nombre,nom); | |
| cantidad=can; | |
| for(int i=0; i<cantidad; i++){ | |
| lib[i].set_titulo(tit); | |
| lib[i].set_autor(aut); | |
| lib[i].set_year(ye); | |
| } | |
| } | |
| void Biblioteca::set_nombre(char nom[]){ | |
| strcpy( nombre,nom); | |
| } | |
| void Biblioteca::set_cantidad(int can){ | |
| cantidad=can; | |
| } | |
| void Biblioteca::mostrar_lista(char nom[]){ | |
| // int cont=0; | |
| for(int i=0; i<cantidad; i++){ | |
| if(strcmp(nom,lib[i].get_autor())==0){ | |
| //cont++; | |
| // cout<<"\n"<<lib[cont-1].get_titulo(); | |
| cout<<lib[i].get_titulo(); | |
| } | |
| } | |
| } | |
| void Biblioteca::mostrar_lista(int ano){ | |
| int cont=0; | |
| for(int i=0; i<cantidad; i++){ | |
| if(ano==lib[i].get_year()){ | |
| cont++; | |
| cout<<"\n"<<lib[cont-1].get_titulo(); | |
| } | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment