El código fuente c++ del sistema de gestión de bibliotecas es urgente.
{ system(" cls ");
CNode * pNode
CTelRecord * pTel
char szName[20], szNumber[20], kind[20], escritor[20];
cout & lt& lt" \n\t\t ◇ Ingrese el título del libro (ingrese 0 para finalizar ) :";
cin.getline (szName, 20);
while(strcmp(szName, " 0 "))
{
cout & lt& lt" \t\t ◇ Ingrese el número del libro: ";
cin.getline(szNumber, 20);
cout & lt& lt" \ t\t ◇Ingrese el tipo de libro (ciencias sociales, examen de autoaprendizaje, literatura, libro de referencia, otro): ";
cin.getline(kind, 20);
cout & lt& lt" \ t\t ◇Por favor, introduzca el nombre del autor: ";
cin.getline(escritor, 20);
pTel = new CTelRecord
pTel-& gt; SetRecord(szName, szNumber, tipo, escritor)
pNode = nuevo CNode
pNode-& gt; p>
ListaTel. add node(pNode);
System("cls");
cout & lt& lt" \n\t\t ☆ Ingrese un título (ingrese 0 para finalizar): ";
cin.getline(szName, 20);
}
cout & lt& ltendl & lt& ltendl
} p>
registro de visualización nulo(CList & TelList)
{ system(" cls ");
cout & lt& ltendl & lt& ltsetw(15)& lt;& lt "☆Título☆" & lt;& ltsetw(15)& lt;& lt" \t☆número de libro☆" & lt;& ltsetw(15)& lt;& lt" \t ☆Tipo de libro☆" lt;& ltsetw(15)& lt;& lt" \t ☆Author☆\n " < & lt;endl
TelList. ShowList();
cout & lt& ltendl & lt& ltendl
}
anular registro de búsqueda (CList & amp; TelList)
{ system(" cls ");
CNode * pLook
char SZ nombre[20];
cout & lt& lt"\n\t\t ☆Ingrese el título del libro que está buscando (ingrese 0 para finalizar)";
cin.getline(szName, 20);
while(strcmp(szName, " 0 " ))
{
CTelRecord tele(szName, " 0 ", " 0 ", " 0 ");
pLook=TelList.
Buscar(Teléfono);
If(pLook)
{
cout & lt& ltendl & lt& lt" \ t \ t. ※
cout & lt& ltendl & lt& ltsetw(15)& lt;& lt"☆Título☆;" & lt;& ltsetw(15)& lt;& lt" \t☆ISBN☆;" 15)<<" \t☆Tipo de libro☆"<<setw(15)<<" \t☆Autor☆\n" <<endl
pLook-& gt;ShowNode() ;
}
Otro
cout & lt& lt" \n\t\t! ! ! No encontrado"
sistema("pausa");
sistema("cls");
cout & lt& lt"\n\t\t ☆ Por favor ingrese el título del libro que está buscando (ingrese 0 para finalizar)";
cin.getline(szName, 20);
}
cout & lt& ltendl & lt& ltendl
}
void DeleteRecord(CList & amp; TelList)
{ system(" cls "
);CNode * pLook
char SZ name[20];
cout & lt& lt“\n\t\t△Ingrese el título del libro que desea eliminar (ingrese 0 para finalizar )";
cin.getline(szName, 20);
while (strcmp(szName, " 0 "))
{
CTelRecord tele(szName," 0"," 0"," 0");
pLook=TelList.look(teléfono);
if( pLook)
{
cout & lt& lt" \n\t\t☆Se encontró el registro "< & ltszName & lt& lt", el contenido es:\ n p>
cout & lt& ltendl & lt& ltsetw(15)& lt;& lt"☆Título☆;" & lt;& ltsetw(15)& lt;& lt" \t☆ISBN☆;" & ltsetw(15)& <gt;ShowNode();
TelList.
eliminar nodo(pLook);
cout & lt& lt" \ n \ t \ t◎;" & lt;& ltszName & lt& lt" los datos han sido eliminados"
}
Otro
cout & lt& lt" \n\t\t▲Lo siento, no puedo encontrar " < & ltszName & lt& lt" ."& lt& ltendl p>
System("pause");
System("cls");
cout & lt& lt"\n\t\t△Ingrese la información que desea eliminar El título del libro (ingrese 0 para finalizar)";
cin.getline(szName, 20);
}
cout & lt& ltendl & lt& ltendl
p>}
archivo de almacenamiento nulo (CList y TelList)
{
archivo de salida ofstream("BOOK.dat " , IOs:: binario);
if (!archivo de salida)
{
cout & lt& lt" \t\t\t!!! Error abriendo archivo de datos, no se pueden almacenar datos";
Return;
}
CNode * pnode
CTelRecord * pTel
Cadena strName, strNumber
pnode=TelList. getlist head();
mientras(pnodo)
{
pTel =(CTelRecord *)pnodo-& gt;obtener datos();
outfile.write((char *)pTel, sizeof(CTelRecord));
pnode=TelList. GetListNextNode(pnode);}
outfile . close();
}
Operación no válida (String & ampstrChoice, CList & ampTelList)
Void Tongji (CList y ampTelList);
if(strChoice=="1 ")
añadir registro(TelList);
si no( strChoice =="2 ")
mostrar registro(TelList);
si no(strChoice=="3 ")
buscar registro(TelList); /p>
else if(strChoice=="4 ")
DeleteRecord(TelList);
else if(strChoice=="5 ")
Tongji(TelList);
else if(strChoice=="0 ")
almacenar archivo(TelList);
Otros
cout & lt& lt" \n\t\t\t!!! Error de entrada, vuelva a ingresar su elección.
"< & ltendl
}
void LoadFile(CList & TelList)
{
ifstream infile("BOOK.dat ", IOs::binary);
if (!infile)
{
cout & lt& lt" \n\t\t! ! ! Lo sentimos, no se encontró el archivo de datos y no se pueden importar los datos. ";
Regresar;
}
CNode * pNode
CTelRecord * pTel
Y (!infile .eof())
{
pTel = nuevo CTelRecord
infile.read((char *)pTel, sizeof(ctel record)); p> p>
pNode = nuevo CNode
pNode-& gt; datos de entrada (pTel
TelList agregar nodo (pNode); }
TelList.eliminar nodo(pNode);
infile()
}
Void Tongji (CList y ampTelList). )
{ system(" cls ");
int a, b, I, j, k, d, e, f, g, m, n
CTelRecord sk("0","0","Ciencias Sociales","0");
CTelRecord zk("0","0","Zike","0")
CTelRecord wx("0","0","literatura","0");
CTelRecord gj("0","0","libro de referencia" , " 0 ");
CTelRecord qt("0", "0", "otro", "0");
a=TelList.Tongji(sk);
p>
b=TelList.Tongji(ZK);
i=TelList.Tongji(wx);
j=TelList.Tongji(gj );
k = tellist . Tongji(Qt);
cout & lt& lt\ t ' & lt& lt" ↑"& lt;& ltendl
for(d = 20; d & gt0;d-)cout & lt;& ltd+50 & lt;& lt\ t ' & lt& lt"│" & lt;& ltendl
For (d =50, e=50 , f=50, g=50, m=50, n = 50e & gt0;d -, e -, f -, g -, m -, n -)
{ cout & lt& ltd & lt& lt\ t ' & lt& lt"│";
if (e & gta)cout & lt;& lt" ";else cout & lt& lt"■";
cout & lt& lt\ t ';
if(f & gt;b)cout<.
& lt" ";else cout & lt& lt"■";
cout & lt& lt\ t ';
if(g & gt;I)cout & lt;& lt " ";else cout & lt& lt"■";
cout & lt& lt\ t ';
if (m & gtj)cout & lt;& lt" ";else cout & lt& lt"■";
cout & lt& lt\ t ';
if (n & gtk)cout & lt;& lt" ";si no cout & lt& lt "■";
cout & lt& ltendl
}
cout & lt& lt"——————————"<& ltendl
cout & lt& lt\ t ' & lt& lta & lt& lt" " " & lt& lt\ t ' & lt& ltb & lt& lt" " " & lt& lt\ t ' & lt& ltI& lt& lt" " " & lt& lt\ t ' & lt& ltj & lt& lt" " " & lt& lt\ t ' & lt& ltk & lt& lt" " " & lt& ltendl
cout & lt& lt" " " & lt& lt"Ciencias Sociales"
}
int main()
{
CList TelList
Sistema ("cls");
cout & lt& ltendl & lt& lt" \ t \ t \ t ☆☆Bienvenido al sistema de gestión de bibliotecas☆☆\ n "
LoadFile( TelList);
String strChoice
Hacer
{
cout & lt& ltendl & lt& lt" \ n \ t \ t, ※1. Agregar registro del libro\ n " & lt& ltendl
cout & lt& lt"\ t \ t \ t,※2. Mostrar información del libro\ n " & lt& ltendl
cout & lt& lt" \ t \ t \ t. ※. Buscar información del libro según el título \ n " & lt& ltendl
cout & lt& lt" \ t \ t \ t. ※. Eliminar información del libro según el título \ n " & lt& ltendl
cout & lt& lt"\ t \ t \ t 5. Imprimir infografía del libro\n " & lt& ltendl
cout & lt& lt" \t \t \tEjecutar 0. Salga del sistema"
cout & lt& lt" \t\t\t ★Ingrese su elección: ";
CIN & gt;& gtstrChoice
CIN .ignore();
Operar(strChoice, TelList);
} while (strChoice!="0");
cout & lt& lt" \ n \ n \ t \ t ※※※※Bienvenido al sistema de gestión de bibliotecas ※※※\ n \ n”
Regresar
}
Lo anterior es el código para cada parte
.