我的编程空间,编程开发者的网络收藏夹
学习永远不晚

C++如何实现图书管理系统

短信预约 -IT技能 免费直播动态提醒
省份

北京

  • 北京
  • 上海
  • 天津
  • 重庆
  • 河北
  • 山东
  • 辽宁
  • 黑龙江
  • 吉林
  • 甘肃
  • 青海
  • 河南
  • 江苏
  • 湖北
  • 湖南
  • 江西
  • 浙江
  • 广东
  • 云南
  • 福建
  • 海南
  • 山西
  • 四川
  • 陕西
  • 贵州
  • 安徽
  • 广西
  • 内蒙
  • 西藏
  • 新疆
  • 宁夏
  • 兵团
手机号立即预约

请填写图片验证码后获取短信验证码

看不清楚,换张图片

免费获取短信验证码

C++如何实现图书管理系统

本文小编为大家详细介绍“C++如何实现图书管理系统”,内容详细,步骤清晰,细节处理妥当,希望这篇“C++如何实现图书管理系统”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。

功能:

首先是注册,登录,找回密码和修改密码功能,登录和注册使用了多态,并且登录页面采用了*符号加密。
2.管理员在删除图书时,若用户此时已将此书借走,则会将此书从用户的借书书单中删去,实现了动态管理。
3.容错率极高,每个页面都有返回上一页面的功能。
4.每个页面都有设置有滚键盘机制,提高了容错率。

菜单:

#pragma oncevoid _mainmenu();void Loginmenu();void Registmenu();void readermenu();void mangermenu();void changebookmenu();void browsemenu();

菜单文件

#include "menu.h"#include <cstdio>void _mainmenu(){    printf("\n\n");    printf("                                        欢 迎 使 用 图 书 管 理 系 统 !\n");    printf("                              **************************************************\n");    printf("                              **                    1.登录                    **\n");    printf("                              **                                              **\n");    printf("                              **                    2.注册                    **\n");    printf("                              **                                              **\n");    printf("                              **                    3.找回密码                **\n");    printf("                              **                                              **\n");    printf("                              **                    4.退出                    **\n");    printf("                              **************************************************\n");    printf("请按键选择:");}void Loginmenu(){    printf("                                                   登录页面\n");    printf("                              **************************************************\n");    printf("                              **                 1.管理员登录                 **\n");    printf("                              **                                              **\n");    printf("                              **                 2.用户登录                   **\n");    printf("                              **                                              **\n");    printf("                              **                 3.返回                       **\n");    printf("                              **                                              **\n");    printf("                              **                 4.退出                       **\n");    printf("                              **************************************************\n");    printf("请按键选择:");}void Registmenu(){    printf("                                                   注册页面\n");    printf("                              **************************************************\n");    printf("                              **                 1.管理员注册                 **\n");    printf("                              **                                              **\n");    printf("                              **                 2.用户注册                   **\n");    printf("                              **                                              **\n");    printf("                              **                 3.返回                       **\n");    printf("                              **                                              **\n");    printf("                              **                 4.退出                       **\n");    printf("                              **************************************************\n");    printf("请按键选择:");}void readermenu(){    printf("                                                  用户页面\n");    printf("                              **************************************************\n");    printf("                              **               1.借书                         **\n");    printf("                              **                                              **\n");    printf("                              **               2.还书                         **\n");    printf("                              **                                              **\n");    printf("                              **               3.浏览图书信息                 **\n");    printf("                              **                                              **\n");    printf("                              **               4.查看已借阅书籍               **\n");    printf("                              **                                              **\n");    printf("                              **               5.修改密码                     **\n");    printf("                              **                                              **\n");    printf("                              **               6.返回                         **\n");    printf("                              **                                              **\n");    printf("                              **               7.退出                         **\n");    printf("                              **************************************************\n");    printf("请按键选择:");}void mangermenu(){    printf("                                                管理员页面\n");    printf("                              **************************************************\n");    printf("                              **               1.增加图书                     **\n");    printf("                              **                                              **\n");    printf("                              **               2.删除图书                     **\n");    printf("                              **                                              **\n");    printf("                              **               3.修改图书信息                 **\n");    printf("                              **                                              **\n");    printf("                              **               4.查看读者信息                 **\n");    printf("                              **                                              **\n");    printf("                              **               5.浏览图书信息                 **\n");    printf("                              **                                              **\n");    printf("                              **               6.修改密码                     **\n");    printf("                              **                                              **\n");    printf("                              **               7.返回                         **\n");    printf("                              **                                              **\n");    printf("                              **               8.退出                         **\n");    printf("                              **************************************************\n");    printf("请按键选择:");}void changebookmenu(){    printf("\n\n");    printf("\t\t\t\t*******************************\n");    printf("\t\t\t\t**      1.修改id号           **\n");    printf("\t\t\t\t**                           **\n");    printf("\t\t\t\t**      2.修改图书名称       **\n");    printf("\t\t\t\t**                           **\n");    printf("\t\t\t\t**      3.修改图书作者       **\n");    printf("\t\t\t\t**                           **\n");    printf("\t\t\t\t**      4.修改出版社         **\n");    printf("\t\t\t\t**                           **\n");    printf("\t\t\t\t**      5.修改图书数量       **\n");    printf("\t\t\t\t**                           **\n");    printf("\t\t\t\t**      6.修改是否可借       **\n");    printf("\t\t\t\t**                           **\n");    printf("\t\t\t\t**      7.返回               **\n");    printf("\t\t\t\t*******************************");    printf("\n\n");}void browsemenu(){    printf("\n\n\n\n");    printf("\t\t\t\t***********************************\n");    printf("\t\t\t\t**         1.按id号浏览          **\n");    printf("\t\t\t\t**                               **\n");    printf("\t\t\t\t**         2.按图书数量浏览      **\n");    printf("\t\t\t\t**                               **\n");    printf("\t\t\t\t**         3.返回                **\n");    printf("\t\t\t\t**                               **\n");    printf("\t\t\t\t**         4.退出                **\n");    printf("\t\t\t\t***********************************\n");    printf("请按键选择:");}

主程序

#define _CRT_SECURE_NO_WARNINGS#include <iostream>#include <Windows.h>#include <string>#include <fstream>#include <conio.h>#include "menu.h"using namespace std;class User{protected :    char account[20];    char password[20];    char spassword[20];public :    virtual void Login() = 0;    virtual void Regist() = 0;    virtual void save() = 0;    virtual void BrowseBook() = 0;    virtual void ChangePassword() = 0;    virtual void FindPassword() = 0;};class Reader : public User{private:    int number;    string name;    string sex;    int books; // 借书数量    int bookcnt;// 借阅次数    char booklist[20][20];// 储存借阅书籍    class Reader* next;public :    virtual void Login();    virtual void Regist();    virtual void save();    virtual void BrowseBook();    virtual void ChangePassword();    virtual void FindPassword();    void creat();    void BrowseBorrowBook(Reader* pp);    void BorrowBook(Reader* pp);    void ReturnBook(Reader* pp);    public :    void set_number(int _number) { number = _number; };    void set_name(string _name) { name = _name; };    void set_sex(string _sex) { sex = _sex; };    void set_next(Reader* p) { next = p; };    void set_books(int _books) { books = _books; };    void set_bookcnt(int _bookcnt) { bookcnt = _bookcnt; };    int get_bookcnt() { return bookcnt; };    int get_number() { return number; };    int get_books() { return books; };    Reader* get_next() { return next; }    string get_name() { return name; };    string get_sex() { return sex; };    char* get_account(Reader* p) { return p->account; };    char* get_password(Reader* p) { return p->password; };    char* get_spassword(Reader* p) { return p->spassword; };    char* get_booklist(Reader* p, int i) { return p->booklist[i]; };};class Manger : public User{private:    class Manger* next;public :        virtual void Login();    virtual void Regist();    virtual void BrowseBook();    virtual void save();    virtual void ChangePassword();    virtual void FindPassword();    void creat();    void AddBook();    void ChangeBook();    void DeleteBook();    void DeleteReaderBook(char* bookname);    void BrowseReader();    public :    void set_next(Manger* p) { next = p; };    Manger* get_next() { return next; };    char* get_account(Manger* p) { return p->account; };    char* get_password(Manger* p) { return p->password; };    char* get_spassword(Manger* p) { return p->spassword; };};class Book{private:    int id;    int amount;    int flag;    string bookname;    string author;    string press;    class Book* next;public :        void creat();    void save();    void show_book();    void set_id(int _id) { id = _id; };    void set_amount(int _amount) { amount = _amount; };    void set_flag(int _flag) { flag = _flag; };    void set_bookname(string _bookname) { bookname = _bookname; };    void set_author(string _author) { author = _author; };    void set_press(string _press) { press = _press; };    void set_next(Book* p) { next = p; };    int get_id() { return id; };    int get_amount() { return amount; };    int get_flag() { return flag; };    string get_bookname() { return bookname; };    string get_author() { return author; };    string get_press() { return press; };    Book* get_next() { return next; };};class DBFile{public :    void cls();    void over();    void login();    void useLogin(User* base);    void regist();    void useRegist(User* base);    void usebrowsebook(User* base);    void usesave(User* base);    void usechangepassword(User* base);    void usefindpassword(User* base);    void findpassword();    int exist(char* acconut, int flag);    void _main();    void idsort();    void bookamountsort();    void showidsort();    void showbookamountsort();    void mangerfunction();    void readerfunction(Reader* rp);};Reader* rhead = NULL; Reader* _rend = NULL;Manger* mhead = NULL, * mend = NULL;Book* bhead = NULL; Book* bend = NULL;char code[20] = "glysw";// 读者类void Reader::Login(){    int cnt = 4;    int flag = 0;    int k = 0;    int i;    char c;    DBFile* fp = new DBFile;    Reader* p = rhead->get_next();    char rpassword[2000];    char raccount[2000];    cout << "\n\n\n\n\n\n\n";    printf("请输入您的账户(按0退出):");    while (cin >> raccount)    {        if (strcmp(raccount, "0") == 0)        {            return;        }        if (strlen(raccount) <= 16)        {            break;        }        else        {            cout << "请输入长度为1到16位的账户:";        }    }    cout << "请输入您的密码(按0退出):";    for (i = 0; (c = _getch()) != '\r';)    {        if (c == '0')        {            return;        }        if (i <= 15 && isprint(c))        {            rpassword[i] = c;            i++;            k++;            cout << "*";        }        if (k > 0 && c > 0 && c == '\b')        {            i--;            k--;            cout << "\b";            cout << " ";            cout << "\b";        }    }    rpassword[i] = '\0';    cout << "\n";    while (p)    {        if (strcmp(p->account, raccount) == 0)        {            flag = 1;            while (strcmp(p->password, rpassword) != 0)            {                cnt--;                if (cnt == 1)                {                    fp->cls();                    cout << "\n\n\n\n\n\n\n";                    cout << "密码输入次数已用完! " << "\n" << "即将退出登录页面...";                    Sleep(3000);                    fp->cls();                    return;                }                cout << "密码错误!您还有" << cnt - 1 << "次机会\n" << endl;                cout << "请重新输入(按0退出):";                k = 0;                for (i = 0; (c = _getch()) != '\r';)                {                    if (c == '0')                    {                        return;                    }                    if (i <= 15 && isprint(c))                    {                        rpassword[i] = c;                        i++;                        k++;                        cout << "*";                    }                    if (k > 0 && c > 0 && c == '\b')                    {                        i--;                        k--;                        cout << "\b";                        cout << " ";                        cout << "\b";                    }                }                rpassword[i] = '\0';                cout << "\n";            }            cout << "读者" << raccount << "登陆成功!\n" << "即将跳转至读者页面..." << endl;            Sleep(2000);            fp->cls();            fp->readerfunction(p);            return;        }        p = p->get_next();    }    if (!flag)    {        cout << "不存在此账号!\n请先前往注册!\n" << endl;        cout << "即将跳转至主页面...";        Sleep(2000);    }}void Reader::Regist(){    DBFile* fp = new DBFile;    Reader* rp = new Reader;    char raccount[2000];    char rpassword[2000];    char rspassword[2000];    char name[200];    char sex[10];    int number;    Reader* p = new Reader;    cout << "\n\n\n\n\n\n\n";    cout << "请输入账户(按0退出):";    while (cin >> raccount)    {        if (strcmp(raccount, "0") == 0)        {            return;        }        if (strlen(raccount) <= 16 && !fp->exist(raccount, 0))        {            break;        }        else if (fp->exist(raccount, 1))        {            cout << "该账户已存在!请重新输入(按0退出):";        }        else        {            cout << "请输入长度为1到16位的账户:";        }    }    strcpy_s(p->account, raccount);    cout << "请输入密码(按0退出):";    while (cin >> rpassword)    {        if (strcmp(rpassword, "0") == 0)        {            return;        }        if (strlen(rpassword) <= 16)        {            break;        }        else        {            cout << "请输入长度为1到16位的密码(按0退出):";        }    }    strcpy_s(p->password, rpassword);    cout << "请输入您的密保(按0退出):";    while (cin >> rspassword)    {        if (strcmp(rspassword, "0") == 0)        {            return;        }        if (strlen(rspassword) <= 16)        {            break;        }        else        {            cout << "请输入长度为1到16位的密保(按0退出):";        }    }    strcpy_s(p->spassword, rspassword);    cout << "请输入您的姓名(按0退出):";    cin >> name;    if (strcmp(name, "0") == 0)    {        return;    }    p->name = name;    cout << "请输入您的性别(按0退出):";    while (cin >> sex)    {        if (strcmp(sex, "0") == 0)            {                return;            }        if (strcmp(sex, "男") == 0 || strcmp(sex, "女") == 0)        {            p->sex = sex;            break;        }        else        {            cout << "请输入男或女(按0退出):";        }    }        cout << "请输入您的学号(按0退出):";    while (cin >> number)    {        if (number == 0)        {            return;        }        if (number >= 0)        {            p->number = number;            break;        }         else        {            cout << "请输入正确格式的学号(按0退出):";        }    }    _rend->set_next(p);    _rend = p;    _rend->set_next(NULL);    rp->save();    fp->cls();    printf("\n\n\n\n\n\n\n");    printf("\t\t\t\t\t*******************************\n");    printf("\t\t\t\t\t**                           **\n");    printf("\t\t\t\t\t       读者%s注册成功!!     \n", raccount);    printf("\t\t\t\t\t**     即将跳转至主页面...   **\n");    printf("\t\t\t\t\t**                           **\n");    printf("\t\t\t\t\t*******************************\n");    Sleep(1500);}void Reader::save(){    Reader* rp = rhead->get_next();    ofstream f_reader("reader.txt", ios::out);    while (rp)    {        f_reader << rp->account << " " << rp->password << " " << rp->spassword << " " << rp->number            << " " << rp->name << " " << rp->sex << " " << rp->bookcnt << " " << rp->books;        for (int i = 0; i < rp->bookcnt; i++)        {            f_reader << " " << booklist[i];        }        f_reader << endl;        rp = rp->get_next();    }    f_reader.close();}void Reader::BrowseBook(){    DBFile* fp = new DBFile;    int sign = 0;    while (1)    {        fp->cls();        browsemenu();        char choose = _getch();        switch (choose)        {        case '1':            fp->cls();            fp->showidsort();            break;        case '2':            fp->cls();            fp->showbookamountsort();            break;        case '3':            fp->cls();            sign = 1;            break;        case '4':            fp->cls();            fp->over();            break;        default:            break;        }        if (sign)        {            break;        }    }}void Reader::creat(){    ifstream f_reader("reader.txt", ios::in);    char _account[20];    char _password[20];    char _spassword[20];    int number;    int bookcnt;    int books;    char name[20];    char sex[20];    char booklist[20][20];    while (f_reader >> _account && f_reader >> _password && f_reader >> _spassword)    {        Reader* p = new Reader;        strcpy_s(p->account, _account);        strcpy_s(p->password, _password);        strcpy_s(p->spassword, _password);        _rend->set_next(p);        p->set_next(NULL);        _rend = _rend->get_next();    }    while (f_reader >> number && f_reader >> name && f_reader >> sex         && f_reader >> bookcnt && f_reader >> books)    {        Reader* p = new Reader;        p->number = number;        p->sex = sex;        p->name = name;        p->bookcnt = bookcnt;        p->books = books;        _rend->set_next(p);        p->set_next(NULL);        _rend = _rend->get_next();    }    while (f_reader >> bookcnt)    {        Reader* p = new Reader;        for (int i = 0; i < bookcnt; i++)        {            f_reader >> booklist[i];            strcpy_s(p->booklist[i], booklist[i]);        }        _rend->set_next(p);        p->set_next(NULL);        _rend = _rend->get_next();    }    f_reader.close();}void Reader::BrowseBorrowBook(Reader* pp){    int cnt = pp->bookcnt;    long long  sign;    if (cnt == 0)    {        printf("\n\n\n\n\n\n\n");        printf("\t\t\t\t\t\t您还未借阅任何书籍!\n");    }    printf("\n\n\n\n\n\n");    for (int i = 0; i < cnt; i++)    {        printf("\t第%d次借阅的书籍:", i + 1);        printf("%s\t", pp->get_booklist(pp, i));        cout << "借阅数量:" << pp->get_books() << endl;    }    printf("\n\n请输入0退出:");    while (scanf("%lld", &sign))    {        if (sign == 0)        {            break;        }        else        {            printf("-------------无效的输入!请重新输入!");        }    }}void Reader::BorrowBook(Reader* pp){    Book* bp = bhead->get_next();    Book* _bp = new Book;    _bp->show_book();    char bookname[200];    int amount;    int flag = 1;    int sign = 1;    int exist = 0;    cout << "\n\n\n\n";    cout << "请输入要借书的名称(按0退出):";    cin >> bookname;    if (strcmp(bookname, "0") == 0)    {        return;    }    while (bp)    {        if (bp->get_bookname() == bookname)        {            if (bp->get_amount() == 0)            {                cout << "此书无余量!\n";                sign = 0;            }            if (bp->get_flag() == 0)            {                cout << "此书不可借!\n";                flag = 0;            }            if (sign == 1 && flag == 1)            {                cout << "请输入要借阅书籍的数量:";                while (cin >> amount)                {                    if (bp->get_amount() < amount)                    {                        cout << "借阅数量超过此书已有库存!请重新输入:";                    }                    else                    {                        int a = pp->get_books() + amount;                        pp->set_books(a);                        int b = bp->get_amount() - amount;                        bp->set_amount(b);                        break;                    }                }                pp->bookcnt++;                strcpy_s(pp->booklist[pp->bookcnt - 1], bookname);                pp->save();                bp->save();                exist = 1;                break;            }        }        bp = bp->get_next();    }    if (exist == 0 && sign == 1 && flag == 1)    {        cout << "不存在此书!!\n";    }    else if (exist == 1)    {        cout << "图书:" << bookname << "借阅成功!!\n";    }    cout << "页面即将跳转...";    Sleep(1200);}void Reader::ReturnBook(Reader* pp){    Book* bp = bhead->get_next();    char bookname[200];    int amount;    int exist = 0;    int flag = 0;    int cnt = pp->bookcnt;    if (cnt == 0)    {        printf("\n\n\n\n\n\n\n");        printf("\t\t\t\t\t\t您还未借阅任何书籍!\n");        system("pause");        return;    }    printf("\n\n\n\n\n\n");    for (int i = 0; i < cnt; i++)    {        cout << "-------------第" << i + 1 << "次借阅的书籍:" << pp->booklist[i] << "\t\t";        cout << "借阅数量:" << pp->books << endl;    }    cout << "请输入您要退还的书籍(按0退出):";    while (cin >> bookname)    {        if (strcmp(bookname, "0") == 0)        {            return ;        }        for (int i = 0; i < pp->bookcnt; i++)        {            if (strcmp(pp->booklist[i], bookname) == 0)            {                flag = i;                exist = 1;                break;            }        }        if (!exist)        {            cout << "未查询到该书!\n";            cout << "请重新输入(按0退出):";        }        else        {            break;        }    }    while (bp)    {        if (bp->get_bookname() == bookname)        {            cout << "请输入您要退还书籍的数量:";            while (cin >> amount)            {                if (pp->books < amount)                {                    cout << "您未持有此数量的书籍!\n";                    cout << "请重新输入:";                }                else                {                    int a = pp->books - amount;                    int b = bp->get_amount() + amount;                    pp->set_books(a);                    bp->set_amount(b);                    break;                 }            }        }        bp = bp->get_next();    }    if (pp->books == 0)    {        for (int i = flag; i < pp->books - 1; i++)        {            strcpy_s(pp->booklist[i], pp->booklist[i + 1]);        }        pp->bookcnt--;    }    pp->save();    bp->save();    cout << bookname << "退还成功!!\n";    cout << "即将返回上一页面...";    Sleep(1100);}void Reader::FindPassword(){    Reader* rp = rhead->get_next();    char password[200];    char account[200];    char spassword[200];    int flag = 0;    int sign = 0;    cout << "请输入您的账户(按0退出):";    while (cin >> account)    {        if (strcmp(account, "0") == 0)        {            return;        }        while (rp)        {            if (strcmp(rp->get_account(rp), account) == 0)            {                flag = 1;                break;            }            rp = rp->get_next();        }        if (flag)        {            break;        }        else        {            printf("此账号不存在!请重新输入(按0退出):");            rp = rhead->get_next();        }    }    if (flag)    {        rp = rhead->next;        printf("请输入您设置的密保(按0退出):");        while (cin >> spassword)        {            if (strcmp(spassword, "0") == 0)            {                return;            }            while (rp)            {                if (strcmp(rp->get_spassword(rp), spassword) == 0)                {                    sign = 1;                    break;                }                rp = rp->get_next();            }            if (sign)            {                printf("密保输入正确!\n");                printf("您的密码为%s\n", rp->get_password(rp));                system("pause");                return;            }            else            {                printf("-------------密保输入错误!请重新输入(按0退出):");                rp = rhead->get_next();            }        }    }}void Reader::ChangePassword(){    DBFile* fp = new DBFile;    Reader* p = rhead->get_next(), * rp = new Reader;    int flag = 0;    int sign = 0;    char raccount[200];    char rpassword[200];    char rspassword[200];    cout << "请输入您的账户(按0退出):";    while (cin >> raccount)    {        if (strcmp(raccount, "0") == 0)        {            return;        }        while (p)        {            if (strcmp(p->account, raccount) == 0)            {                flag = 1;                break;            }            p = p->get_next();        }        if (flag)        {            break;        }        else        {            cout << "此账号不存在!请重新输入(按0退出):";            p = rhead->get_next();        }    }    if (flag)    {        p = rhead->get_next();        cout << "请输入您设置的密保(按0退出):";        while (cin >> rspassword)        {            if (strcmp(rspassword, "0") == 0)            {                return;            }            while (p)            {                if (strcmp(p->spassword, rspassword) == 0)                {                    sign = 1;                    break;                }                p = p->get_next();            }            if (sign)            {                cout << "请输入修改后的密码(按0退出):";                while (cin >> rpassword)                {                    if (strcmp(rpassword, "0") == 0)                    {                        return;                    }                    if (strlen(rpassword) <= 16)                    {                        break;                    }                    else                    {                        cout << "请输入长度为1到16位的密码(按0退出):";                    }                }                strcpy_s(p->password, rpassword);                cout << "密码修改成功!";                fp->usesave(p);                system("pause");                return;            }            else            {                cout << "密保输入错误!!请重新输入(按0退出):";                p = rhead->get_next();            }        }    }}// 数据操作类void DBFile::cls(){    system("cls");}void DBFile::over(){    DBFile* dbp = new DBFile;    dbp->cls();    system("color 6");    int time = 6;    printf("\n\n\n\n\n\n\n\n\n");    printf("\t\t\t\t\t\t感谢您的使用!!\n\n\n\n\n");    printf(" 程序即将关闭...");    while (--time >= 1)    {        printf("\r%d", time);        printf("\b");        Sleep(1000);    }    dbp->cls();    exit(0);}void DBFile::login(){    Reader* rp = new Reader;    Manger* mp = new Manger;    int sign = 0;    while (1)    {        cls();        Loginmenu();        char choose = _getch();        switch (choose)        {        case '1':            cls();            useLogin(mp);            break;        case '2':            cls();            useLogin(rp);            break;        case '3':            cls();            sign = 1;            break;        case '4':            cls();            over();            break;        default:            cout << "输入无效!!";            break;        }        if (sign)        {            break;        }    }}void DBFile::useLogin(User* base){    base->Login();}void DBFile::regist(){    Reader* rp = new Reader;    Manger* mp = new Manger;    int sign = 0;    while (1)    {        cls();        Registmenu();        char choose = _getch();        switch (choose)        {        case '1':            cls();            useRegist(mp);            break;        case '2':            cls();            useRegist(rp);            break;        case '3':            cls();            sign = 1;            break;        case '4':            cls();            over();            break;        default:            cout << "无效输入!!";            break;        }        if (sign)        {            break;        }    }}void DBFile::usesave(User* base){    base->save();}void DBFile::usechangepassword(User* base){    base->ChangePassword();}void DBFile::useRegist(User* base){    base->Regist();}void DBFile::usebrowsebook(User* base){    base->BrowseBook();}void DBFile::usefindpassword(User* base){    base->FindPassword();}void DBFile::findpassword(){    printf("\n\n\n\n\n\n");    printf("\t\t\t\t\t********************************\n");    printf("\t\t\t\t\t**                            **\n");    printf("\t\t\t\t\t**      1.管理员找回密码      **\n");    printf("\t\t\t\t\t**                            **\n");    printf("\t\t\t\t\t**      2.用户找回密码        **\n");    printf("\t\t\t\t\t**                            **\n");    printf("\t\t\t\t\t**      3.返回                **\n");    printf("\t\t\t\t\t**                            **\n");    printf("\t\t\t\t\t********************************\n");    printf("请按键选择:");    int choose;    int sign = 0;    Reader* rp = new Reader;    Manger* mp = new Manger;    scanf("%d", &choose);    while (1)    {        cls();        switch (choose)        {        case 1:            cls();            usefindpassword(mp);            sign = 1;            break;        case 2:            cls();            usefindpassword(mp);            sign = 1;            break;        case 3:            sign = 1;            break;        default:            printf("输入无效!");            break;        }        if (sign)        {            break;        }    }}int DBFile::exist(char* account, int flag){    if (flag == 0)    {        Reader* p = rhead->get_next();        while (p != NULL)        {            if (strcmp(account, p->get_account(p)) == 0)            {                return 1;            }            p = p->get_next();        }    }    else if (flag == 1)    {        Manger* p = mhead->get_next();        while (p != NULL)        {            if (strcmp(account, p->get_account(p) ) == 0)            {                return 1;            }            p = p->get_next();        }    }    return 0;}void DBFile::_main(){    while (1)    {        cls();        _mainmenu();        char choose = _getch();        switch (choose)        {        case '1':            cls();            login();            break;        case '2':            cls();            regist();            break;        case '3':            cls();            findpassword();            break;        case '4':            cls();            over();            break;        default:            cout << "无效输入!!";            break;        }    }}void DBFile::idsort(){    Book* f, *x, *y, *p;    f = NULL;    if (bhead->get_next() == NULL || bhead->get_next()->get_next() == NULL)    {        return;    }    while (f != bhead->get_next()->get_next())    {        for (p = bhead; p->get_next()->get_next() != f; p = p->get_next())        {            if (p->get_next()->get_id() > p->get_next()->get_next()->get_id())            {                x = p->get_next();                y = p->get_next()->get_next();                p->set_next(y);                x->set_next(y->get_next());                y->set_next(x);            }        }        f = p->get_next();    }}void DBFile::bookamountsort(){    Book* f, * x, * y, * p;    f = NULL;    if (bhead->get_next() == NULL || bhead->get_next()->get_next() == NULL)    {        return;    }    while (f != bhead->get_next()->get_next())    {        for (p = bhead; p->get_next()->get_next() != f; p = p->get_next())        {            if (p->get_next()->get_amount() > p->get_next()->get_next()->get_amount())            {                x = p->get_next();                y = p->get_next()->get_next();                p->set_next(y);                x->set_next(y->get_next());                y->set_next(x);            }        }        f = p->get_next();    }}void DBFile::showidsort(){    DBFile* fp = new DBFile;    Book* bp = new Book;    fp->idsort();    bp->show_book();    system("pause");}void DBFile::showbookamountsort(){    DBFile* fp = new DBFile;    Book* bp = new Book;    fp->bookamountsort();    bp->show_book();    system("pause");}void DBFile::mangerfunction(){    DBFile* fp = new DBFile;    Manger* mp = new Manger;    int sign = 0;    int choose;    while (1)    {        fp->cls();        mangermenu();        cin >> choose;        switch (choose)        {        case 1:            fp->cls();            mp->AddBook();            break;        case 2:            fp->cls();            mp->DeleteBook();            break;        case 3:            fp->cls();            mp->ChangeBook();            break;        case 4:            fp->cls();            mp->BrowseReader();            break;        case 5:            fp->cls();            mp->BrowseBook();            break;        case 6:            fp->cls();            fp->usechangepassword(mp);            break;        case 7:            fp->cls();            sign = 1;            break;        case 8:            fp->cls();            fp->over();            break;        default:            cout << "输入无效!!";            break;        }        if (sign)        {            break;        }    }}void DBFile::readerfunction(Reader* pp){    DBFile* fp = new DBFile;    Reader* rp = new Reader;    int sign = 0;    while (1)    {        fp->cls();        readermenu();        char choose = _getch();        switch (choose)        {        case '1':            fp->cls();            rp->BorrowBook(pp);            break;        case '2':            fp->cls();            rp->ReturnBook(pp);            break;        case '3':            fp->cls();            fp->usebrowsebook(rp);            break;        case '4':            fp->cls();            rp->BrowseBorrowBook(pp);            break;        case '5':            fp->cls();            fp->usechangepassword(rp);            break;        case '6':            fp->cls();            sign = 1;            break;        case '7':            fp->over();            break;        default:            cout << "输入无效!!";            break;        }        if (sign)        {            break;        }    }}// 管理员类void Manger::Login(){    int cnt = 4;    int flag = 0;    int k = 0;    int i;    char c;    DBFile* fp = new DBFile;    Manger* p = mhead->get_next();    char mpassword[2000];    char maccount[2000];    cout << "\n\n\n\n\n\n\n";    printf("请输入您的账户(按0退出):");    while (cin >> maccount)    {        if (strcmp(maccount, "0") == 0)        {            return;        }        if (strlen(maccount) <= 16)        {            break;        }        else        {            cout << "请输入长度为1到16位的账户:";        }    }    cout << "请输入您的密码(按0退出):";    for (i = 0; (c = _getch()) != '\r';)    {        if (c == '0')        {            return;        }        if (i <= 15 && isprint(c))        {            mpassword[i] = c;            i++;            k++;            printf("*");        }        if (k > 0 && c > 0 && c == '\b')        {            i--;            k--;            printf("\b");            printf(" ");            printf("\b");        }    }    mpassword[i] = '\0';    printf("\n");    while (p)    {        if (strcmp(p->account, maccount) == 0)        {            flag = 1;            while (strcmp(p->password, mpassword) != 0)            {                cnt--;                if (cnt == 1)                {                    fp->cls();                    cout << "\n\n\n\n\n\n\n";                    cout << "密码输入次数已用完! " << "\n" << "即将退出登录页面...";                    Sleep(3000);                    fp->cls();                    return;                }                cout << "密码错误!您还有"<< cnt - 1 << "次机会\n"<< endl;                cout << "请重新输入(按0退出):";                k = 0;                for (i = 0; (c = _getch()) != '\r';)                {                    if (c == '0')                    {                        return;                    }                    if (i <= 15 && isprint(c))                    {                        mpassword[i] = c;                        i++;                        k++;                        printf("*");                    }                    if (k > 0 && c > 0 && c == '\b')                    {                        i--;                        k--;                        printf("\b");                        printf(" ");                        printf("\b");                    }                }                mpassword[i] = '\0';                printf("\n");            }            cout << "管理员"<< maccount << "登陆成功!\n" << "即将跳转至管理员页面..." << endl;                Sleep(2000);            fp->cls();            fp->mangerfunction();            return;        }        p = p->get_next();    }    if (!flag)    {        cout << "不存在此账号!\n请先前往注册!\n" << endl;        cout << "即将跳转至主页面...";        Sleep(2000);    }}void Manger::Regist(){    DBFile* fp = new DBFile;    Manger* mp = new Manger;    char maccount[2000];    char mpassword[2000];    char mspassword[2000];    char mangercode[2000];    cout << "\n\n\n\n\n\n\n";    cout << "请输入管理员验证码:";    cin >> mangercode;    int cnt = 2;    while (--cnt >= 0)    {        if (strcmp(mangercode, code) == 0)        {            cout << "管理员验证成功!!\n" << "即将跳转至注册页面...";            Sleep(1000);            fp->cls();            break;        }        else        {            cout << "管理员验证失败!!\n" << "您还有" << cnt + 1 << "次机会\n";            cout << "请重新输入:";            cin >> mangercode;        }        if (cnt == 0)        {            cout << "输入次数已用完\n" << "即将退出管理员注册系统...";            Sleep(1000);            fp->cls();            return;        }    }    Manger* p = new Manger;    cout << "\n\n\n\n\n\n\n";    cout << "请输入账户(按0退出):";    while (cin >> maccount)    {        if (strcmp(maccount, "0") == 0)        {            return;        }        if (strlen(maccount) <= 16 && !fp->exist(maccount, 1))        {            break;        }        else if (fp->exist(maccount, 1))        {            cout << "该账户已存在!请重新输入(按0退出):";        }        else        {            cout << "请输入长度为1到16位的账户:";        }    }    strcpy_s(p->account, maccount);    cout << "请输入密码(按0退出):";    while (cin >> mpassword)    {        if (strcmp(mpassword, "0") == 0)        {            return;        }        if (strlen(mpassword) <= 16)        {            break;        }        else        {            cout << "请输入长度为1到16位的密码(按0退出):";        }    }    strcpy_s(p->password, mpassword);    cout << "请输入您的密保(按0退出):";    while (cin >> mspassword)    {        if (strcmp(mspassword, "0") == 0)        {            return;        }        if (strlen(mspassword) <= 16)        {            break;        }        else        {            cout << "请输入长度为1到16位的密保(按0退出):";        }    }    strcpy_s(p->spassword, mspassword);    mend->set_next(p);    mend = p;    mend->set_next(NULL);    mp->save();    fp->cls();    printf("\n\n\n\n\n\n\n");    printf("\t\t\t\t\t*******************************\n");    printf("\t\t\t\t\t**                           **\n");    printf("\t\t\t\t\t       管理员%s注册成功!!     \n", maccount);    printf("\t\t\t\t\t**     即将跳转至主页面...   **\n");    printf("\t\t\t\t\t**                           **\n");    printf("\t\t\t\t\t*******************************\n");    Sleep(1500);}void Manger::BrowseBook(){    DBFile* fp = new DBFile;    int sign = 0;    while (1)    {        fp->cls();        browsemenu();        char choose = _getch();        switch (choose)        {        case '1':            fp->cls();            fp->showidsort();            break;        case '2':            fp->cls();            fp->showbookamountsort();            break;        case '3':            fp->cls();            sign = 1;            break;        case '4':            fp->cls();            fp->over();            break;        default:            break;        }        if (sign)        {            break;        }    }}void Manger::save(){    Manger* mp = mhead->get_next();    ofstream f_manger("manger.txt", ios::out);    while (mp)    {        f_manger << mp->account << " " << mp->password << " " << mp->spassword << endl;        mp = mp->get_next();    }    f_manger.close();}void Manger::creat(){    char account[20];    char password[20];    char spassword[20];    ifstream f_manger("manger.txt", ios::in);    while (f_manger >> account && f_manger >> password && f_manger >> spassword)    {        Manger* p = new Manger;        strcpy_s(p->account, account);        strcpy_s(p->password, password);        strcpy_s(p->spassword, password);        mend->set_next(p);        p->set_next(NULL);        mend = mend->get_next();    }    f_manger.close();}void Manger::AddBook(){    DBFile* fp = new DBFile;    Book* p = bhead->get_next();    int a;    int id = 0;    int amount;    char bookname[2000];    do    {        fp->cls();        cout << "\n\n\n\n\n";        cout << "请输入要添加书名id(按0退出):";        while (cin >> id)        {            if (id == 0)            {                return;            }            if (id < 0)            {                cout << "请输入正确格式的id号(按0退出):";            }            else            {                break;            }        }        int flag = 0;        while (p)        {            if (p->get_id() == id)            {                flag = 1;                break;            }            p = p->get_next();        }        if (flag)        {            cout << "已查出此书,请输入再次增加图书的数量:";            while (cin >> amount)            {                if (amount <= 199 && amount > 0)                {                    int temp = p->get_amount() + amount;                    p->set_amount(temp);                    cout << "图书" << p->get_bookname() << "添加成功!";                    break;                }                else                {                    cout << "请输入数量为0-199以内的图书:";                }            }        }        else        {            p = new Book;            p->set_id(id);            cout << "请输入增加图书的数量:";            while (cin >> amount)            {                if (amount <= 199 && amount > 0)                {                    p->set_amount(amount);                    break;                }                else                {                    cout << "请输入数量为0-199范围以内的图书:";                }            }            cout << "请输入是否可借:";            int sign = 0;            while (cin >> sign)            {                if (sign == 1 || sign == 0)                {                    p->set_flag(sign);                    break;                }                else if (sign < 0 || sign > 1)                {                    cout << "请输入正确格式的可借标志(1为可借,0为不可借):";                }            }            char bookname[200];            cout << "请输入书名:";            cin >> bookname;            p->set_bookname(bookname);            char author[200];            cout << "请输作者:";            cin >> author;            p->set_author(author);            char press[200];            cout << "请输入出版社:";            cin >> press;            p->set_press(press);            bend->set_next(p);            bend = p;            bend->set_next(NULL);        }        p->save();        fp->cls();        printf("\n\n\n\n\n\n");        printf("\t\t\t\t\t********************************\n");        printf("\t\t\t\t\t**                            **\n");        printf("\t\t\t\t\t      图书%d添加成功!       \n", bend->get_id());        printf("\t\t\t\t\t**                            **\n");        printf("\t\t\t\t\t********************************\n");        Sleep(1000);        fp->cls();        cout << "\n\n\n\n\n";        cout << "是否继续添加?\n" << "继续请按1,返回请按0:";        cin >> a;    } while (a == 1);    printf("页面即将跳转...");    Sleep(1000);}void Manger::ChangeBook(){    DBFile* fp = new DBFile;    Book* p = bhead->get_next();    int id;    int amount;    int flag = 0;    char bookname[200];    char author[200];    char press[200];    int exist = 0;    int sign = 0;    Book* bp = bhead->get_next();    bp->show_book();    cout << "请输入要修改书名的id号(按0退出):";    while (cin >> id)    {        if (id == 0)        {            return;        }        while (p)        {            if (p->get_id() == id)            {                exist = 1;                break;            }            p = p->get_next();        }        if (!exist)        {            p = bhead->get_next();            cout << "为查询到该id号!请重新输入(按0退出):";        }        else        {            break;        }    }    if (!exist)    {        return;    }    else    {        int sign = 0;        int choose;        fp->cls();        changebookmenu();        while (1)        {            cout << "请输入您要进行的操作:";            cin >> choose;            switch (choose)            {            case 1:                cout << "请输入修改后的id号:";                cin >> id;                p->set_id(id);                cout << "修改成功!!\n";                break;            case 2:                cout << "请输入要修改后的图书名称:";                cin >> bookname;                p->set_bookname(bookname);                cout << "修改成功!!\n";                break;            case 3:                cout << "请输入要修改后的作者:";                cin >> author;                p->set_author(author);                cout << "修改成功!!\n";                break;            case 4:                cout << "请输入修改后的出版社:";                cin >> press;                p->set_press(press);                cout << "修改成功!!\n";                break;            case 5 :                cout << "请输入修改后的图书数量:";                while (cin >> amount)                {                    if (amount <= 199 && amount > 0)                    {                        p->set_amount(amount);                        break;                    }                    else                    {                        cout << "请输入0-199以内的图书数量:";                    }                }                cout << "修改成功!!\n";                break;            case 6 :                if (p->get_flag() == 1)                {                    cout << "是否将此书修改为不可借?(1确认,2返回):";                                        while (cin >> flag)                    {                        if (flag == 2)                        {                            break;                        }                        if (flag == 1)                        {                            p->set_flag(1);                            p->save();                            cout << "修改成功!!\n";                            break;                        }                        else                        {                            cout << "请输入正确格式的借书标志!(1确认,2返回):";                        }                    }                }                else if (p->get_flag() == 0)                {                    cout << "是否将此书修改为可借?(1确认,2返回):";                    while (cin >> flag)                    {                        if (flag == 2)                        {                            break;                        }                        if (flag == 1)                        {                            p->set_flag(0);                            p->save();                            cout << "修改成功!!\n";                            break;                        }                        else                        {                            cout << "请输入正确格式的借书标志!(1确认,2返回):";                        }                    }                }                break;            case 7:                sign = 1;                break;            default :                cout << "输入无效!!";                cin.clear();                break;            }            if (sign)            {                break;            }        }    }}void Manger::DeleteBook(){    Book* bp = bhead->get_next();    char bookname[20];    int flag = 0;    bp->show_book();    cout << "请输入您要删除图书的名称(按0退出):";    while (cin >> bookname)    {        if (strcmp(bookname, "0") == 0)        {            return;        }        while (bp)        {            if (bp->get_bookname() == bookname)            {                flag = 1;                break;            }            bp = bp->get_next();        }        if (flag == 0)        {            cout << "未查询到此书!\n" << "请重新输入(按0退出):";            bp = bhead->get_next();        }        else        {            break;        }    }    DeleteReaderBook(bookname);    bp = bhead->get_next();    Book* pp = bhead;    while (bp)    {// bp->next 可能是链表的最后一个        if (bp->get_bookname() == bookname)        {            if (bp->get_next() == NULL)            {                bhead->set_next(NULL);            }            else            {                pp->set_next(bp->get_next());            }        }        pp = pp->get_next();        bp = bp->get_next();    }        cout << "\n\n\n\n\n\n";    cout << "图书" << bookname << "删除成功!!\n";    cout << "页面即将跳转..";    Sleep(1500);    Book* p = new Book;    p->save();}void Manger::DeleteReaderBook(char* bookname){    Reader* rp = rhead->get_next();    Reader* pp = new Reader;    int flag = 0;    while (rp)    {        flag = 1;        for (int i = 0; i < rp->get_bookcnt(); i++)        {            if (strcmp(rp->get_booklist(rp, i), bookname) == 0)            {                flag = i;                break;            }        }        if (flag != 1)        {            for (int j = flag; j < rp->get_bookcnt() - 1; j++)            {                strcpy(rp->get_booklist(rp, j), rp->get_booklist(rp, j + 1));            }            int temp = rp->get_bookcnt();            temp--;            rp->set_bookcnt(temp);        }        rp = rp->get_next();    }    pp->save();}void Manger::BrowseReader(){        cout << "账户\t\t" << "密码\t\t" << "密保\t\t" << "性别\t\t" << "姓名\t\t"        << "学号\t\t" << "借书次数\n";    Reader* rp = rhead->get_next();    while (rp)    {                cout << rp->get_account(rp) << "\t\t" << rp->get_password(rp) << "\t\t" << rp->get_spassword(rp) << "\t\t"             << rp->get_sex() << "\t\t" << rp->get_name() << "\t\t" << rp->get_number() << "\t\t" << rp->get_bookcnt() << endl;        rp = rp->get_next();    }    system("pause");}void Manger::FindPassword(){    Manger* mp = mhead->get_next();    char password[200];    char account[200];    char spassword[200];    int flag = 0;    int sign = 0;    cout << "请输入您的账户(按0退出):";    while (cin >> account)    {        if (strcmp(account, "0") == 0)        {            return;        }        while (mp)        {            if (strcmp(mp->get_account(mp), account) == 0)            {                flag = 1;                break;            }            mp = mp->get_next();        }        if (flag)        {            break;        }        else        {            printf("此账号不存在!请重新输入(按0退出):");            mp = mhead->get_next();        }    }    if (flag)    {        mp = mhead->get_next();        printf("请输入您设置的密保(按0退出):");        while (cin >> spassword)        {            if (strcmp(spassword, "0") == 0)            {                return;            }            while (mp)            {                if (strcmp(mp->get_spassword(mp), spassword) == 0)                {                    sign = 1;                    break;                }                mp = mp->get_next();            }            if (sign)            {                printf("密保输入正确!\n");                printf("您的密码为%s\n", mp->get_password(mp));                system("pause");                return;            }            else            {                printf("-------------密保输入错误!请重新输入(按0退出):");                mp = mhead->get_next();            }        }    }}void Manger::ChangePassword(){    DBFile* fp = new DBFile;    Manger* p = mhead->get_next(), *mp = new Manger;    int flag = 0;    int sign = 0;    char maccount[200];    char mpassword[200];    char mspassword[200];    cout << "请输入您的账户(按0退出):";    while (cin >> maccount)    {        if (strcmp(maccount, "0") == 0)        {            return;        }        while (p)        {            if (strcmp(p->account, maccount) == 0)            {                flag = 1;                break;            }            p = p->get_next();        }        if (flag)        {            break;        }        else        {            cout << "此账号不存在!请重新输入(按0退出):";            p = mhead->get_next();        }    }    if (flag)    {        p = mhead->get_next();        cout << "请输入您设置的密保(按0退出):";        while (cin >> mspassword)        {            if (strcmp(mspassword, "0") == 0)            {                return;            }            while (p)            {                if (strcmp(p->spassword, mspassword) == 0)                {                    sign = 1;                    break;                }                p = p->get_next();            }            if (sign)            {                cout << "请输入修改后的密码(按0退出):";                while (cin >> mpassword)                {                    if (strcmp(mpassword, "0") == 0)                    {                        return;                    }                    if (strlen(mpassword) <= 16)                    {                        break;                    }                    else                    {                        cout << "请输入长度为1到16位的密码(按0退出):";                    }                }                strcpy_s(p->password, mpassword);                cout << "密码修改成功!";                fp->usesave(p);                system("pause");                return;            }            else            {                cout << "密保输入错误!!请重新输入(按0退出):";                p = mhead->get_next();            }        }    }}// 图书类void Book::creat(){    ifstream f_book("book.txt", ios::in);    int id;    int amount;    int flag;    string bookname;    string author;    string press;    while (f_book >> id && f_book >> flag && f_book >> amount && f_book >> bookname        && f_book >> author && f_book >> press)    {        Book* p = new Book;        p->id = id;        p->flag = flag;        p->amount = amount;        p->bookname = bookname;        p->author = author;        p->press = press;        bend->set_next(p);        p->set_next(NULL);        bend = bend->get_next();    }    f_book.close();}void Book::save(){    Book* bp = bhead->get_next();    ofstream f_book("book.txt", ios::out);    while (bp)    {        f_book << bp->id << " " << bp->flag << " " << bp->amount << " "            << bp->bookname << " " << bp->author << " " << bp->press << endl;        bp = bp->get_next();    }    f_book.close();}void Book::show_book(){    Book* bp = bhead->get_next();    cout << "id号\t\t" << "是否可借\t\t" << "数量\t\t" << "书名\t\t" << "作者\t\t" << "出版社\n";    while (bp)    {        cout << bp->get_id() << "\t\t" << bp->get_flag() << "\t\t\t" << bp->get_amount() << "\t\t"            << bp->get_bookname() << "\t\t" << bp->get_author() << "\t\t" << bp->get_press() << "\n";        bp = bp->get_next();    }}int main(){    mhead = new Manger; mend = new Manger; mhead->set_next(NULL); mend = mhead;    rhead = new Reader; _rend = new Reader; rhead->set_next(NULL); _rend = rhead;    bhead = new Book; bend = new Book; bhead->set_next(NULL); bend = bhead;    Reader* rp = new Reader; rp->creat();    Manger* mp = new Manger; mp->creat();    Book* bp = new Book; bp->creat();    DBFile* dbp = new DBFile;    system("color B");    dbp->_main();    delete dbp;    return 0;}

读到这里,这篇“C++如何实现图书管理系统”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注编程网行业资讯频道。

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

C++如何实现图书管理系统

下载Word文档到电脑,方便收藏和打印~

下载Word文档

猜你喜欢

C++如何实现图书管理系统

本文小编为大家详细介绍“C++如何实现图书管理系统”,内容详细,步骤清晰,细节处理妥当,希望这篇“C++如何实现图书管理系统”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。功能:1.首先是注册,登录,找回密码和修改
2023-06-29

C#如何实现图书管理系统

本文小编为大家详细介绍“C#如何实现图书管理系统”,内容详细,步骤清晰,细节处理妥当,希望这篇“C#如何实现图书管理系统”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。一、设计目的通过模拟图书管理系统,实现以下功能
2023-06-29

如何实现C++版图书管理系统

这篇文章主要介绍了如何实现C++版图书管理系统,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。具体内容如下使用介绍图书管理系统源码由两部分组成,第一部分book.h头文件,第二
2023-06-29

C语言如何实现图书管理系统

这篇文章将为大家详细讲解有关C语言如何实现图书管理系统,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。主要内容 开发一个图书信息管理系统,图书信息包括:图书编号、书名、作者、出版社、类别、出版
2023-06-28

C++如何实现小型图书管理系统

这篇文章给大家分享的是有关C++如何实现小型图书管理系统的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。具体内容如下因为课程设计的原因,需要实现一个小型图书管理系统包含功能:问题描述:设计一个系统,对图书信息进行管
2023-06-29

C语言如何实现图书馆管理系统

这篇文章主要介绍了C语言如何实现图书馆管理系统,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。全部代码如下:#include #include
2023-06-20

java如何实现图书管理系统

小编给大家分享一下java如何实现图书管理系统,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!一、背景介绍通过一段时间java编程的学习,需要一个比较综合的实例来进
2023-06-14

C++如何使用链表实现图书管理系统

这篇文章主要为大家展示了“C++如何使用链表实现图书管理系统”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“C++如何使用链表实现图书管理系统”这篇文章吧。具体内容如下一、程序实现功能1.录入书籍
2023-06-29

如何使用C++编写实现图书管理系统

这篇文章将为大家详细讲解有关如何使用C++编写实现图书管理系统,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。具体内容如下为图书管理人员编写一个图书管理系统,图书管理系统的设计主要是实现对图书的管理和相关操
2023-06-29

C++项目开发如何实现图书管理系统

这篇“C++项目开发如何实现图书管理系统”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“C++项目开发如何实现图书管理系统”文
2023-06-29

如何使用C++实现图书信息管理系统

小编给大家分享一下如何使用C++实现图书信息管理系统,希望大家阅读完这篇文章之后都有所收获,下面让我们一起去探讨吧!具体内容如下1.题目:类型有:编号:ISBN书名:name价格:price完成如下的功能:①录入:从键盘输入(或从文件读入)
2023-06-29

如何用C++实现简单图书馆管理系统

这篇文章主要介绍“如何用C++实现简单图书馆管理系统”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“如何用C++实现简单图书馆管理系统”文章能帮助大家解决问题。功能如下:1,添加书籍2,删除书籍(可删
2023-06-29

编程热搜

  • Python 学习之路 - Python
    一、安装Python34Windows在Python官网(https://www.python.org/downloads/)下载安装包并安装。Python的默认安装路径是:C:\Python34配置环境变量:【右键计算机】--》【属性】-
    Python 学习之路 - Python
  • chatgpt的中文全称是什么
    chatgpt的中文全称是生成型预训练变换模型。ChatGPT是什么ChatGPT是美国人工智能研究实验室OpenAI开发的一种全新聊天机器人模型,它能够通过学习和理解人类的语言来进行对话,还能根据聊天的上下文进行互动,并协助人类完成一系列
    chatgpt的中文全称是什么
  • C/C++中extern函数使用详解
  • C/C++可变参数的使用
    可变参数的使用方法远远不止以下几种,不过在C,C++中使用可变参数时要小心,在使用printf()等函数时传入的参数个数一定不能比前面的格式化字符串中的’%’符号个数少,否则会产生访问越界,运气不好的话还会导致程序崩溃
    C/C++可变参数的使用
  • css样式文件该放在哪里
  • php中数组下标必须是连续的吗
  • Python 3 教程
    Python 3 教程 Python 的 3.0 版本,常被称为 Python 3000,或简称 Py3k。相对于 Python 的早期版本,这是一个较大的升级。为了不带入过多的累赘,Python 3.0 在设计的时候没有考虑向下兼容。 Python
    Python 3 教程
  • Python pip包管理
    一、前言    在Python中, 安装第三方模块是通过 setuptools 这个工具完成的。 Python有两个封装了 setuptools的包管理工具: easy_install  和  pip , 目前官方推荐使用 pip。    
    Python pip包管理
  • ubuntu如何重新编译内核
  • 改善Java代码之慎用java动态编译

目录