Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the Book Management system on C++

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

< 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"); printf ("\ t\ t you haven't borrowed any books yet! \ n ");} printf ("\ n\ n "); for (int I = 0; I

< cnt; i++) { printf("\t第%d次借阅的书籍:", i + 1); printf("%s\t", pp->

Get_booklist (pp, I); cout show_book (); char bookname [200]; int amount; int flag = 1; int sign = 1; int exist = 0; cout bookname; if (strcmp (bookname, "0") = = 0) {return } while (bp) {if (bp- > get_bookname () = = bookname) {if (bp- > get_amount () = = 0) {cout get_flag () = = 0) {cout amount) {if (bp- > get_amount ())

< amount) { cout get_books() + amount; pp->

< 0) { cout get_id() == id) { flag = 1; break; } p = p->

Get_next ();} if (flag) {cout > amount) {if (amount 0) {int temp = p-> get_amount () + amount; p-> set_amount (temp); cout set_amount (amount) Break;} else {cout sign) {if (sign = = 1 | | sign = = 0) {p-> set_flag (sign); break } else if (sign

< 0 || sign >

1) {cout bookname; p-> set_bookname (bookname); char author; cout > author; p-> set_author (author); char press [200]; cout > press; p-> set_press (press); bend- > set_next (p) Bend = p; bend- > set_next (NULL);} p-> save (); fp- > cls (); printf ("\ n\ n"); printf ("\ t\ t *\ n") Printf ("\ t\ t *\ n"); printf ("\ t\ t book% d added successfully!\ n", bend- > get_id ()); printf ("\ t\ t *\ n") Printf; Sleep (1000); fp- > cls (); cout get_next (); int id; int amount; int flag = 0; char bookname; char author; char press; int exist = 0 Int sign = 0; Book* bp = bhead- > get_next (); bp- > show_book (); cout > 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 cls (); changebookmenu (); while (1) {cout > choose Switch (choose) {case 1: cout > id; p-> set_id (id); cout bookname; p-> set_bookname (bookname); cout author; p-> set_author (author); cout press P-> set_press (press); cout amount) {if (amount 0) {p-> set_amount (amount); break } else {cout flag) {if (flag = = 2) {break } if (flag = = 1) {p-> set_flag (1); p-> save () Cout flag) {if (flag = = 2) {break } if (flag = = 1) {p-> set_flag (0); p-> save () Cout 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 get_next (); Book* pp = bhead While (bp) {/ / bp- > next may be the last if of the linked list (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 get_bookcnt ()-1; jacks +) {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 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; char mpassword; char mspassword; cout > 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 get_next ();}} if (flag) {p = mhead- > get_next (); cout > 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 > mpassword) {if (strcmp (mpassword, "0") = = 0) {return } if (strlen (mpassword) > 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 id

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report