搜索
首页 电脑/网络 软件

用C语言设计小型图书管理系统

功能:实现某班级的图书信息管理,图书的基本信息包括书号、书名、作者、单价、数量和简介(50字内)等。基本要求: 1. 设计简单的菜单,能够进行系统功能选择。2. 实现信息的录入功能。3. 在已有信息的基础上添加新的记录。4. 删除指定书号的记录。5. 修改指定书号的记录6. 实现信息的浏览功能7. 按书号查询功能8. 按单价排序功能

全部回答

2009-05-10

189 0
    ==================== 以下代码已经编译运行通过,自己改一下就可以了: #include #include #include #include struct bookData { int booknumber; char bookname[30]; int store; }; struct Person { char name[20]; char studynumber[10]; int count; bookData Rbook[2]; //bookData Rbook; }; class History { public: History(fstream& a){readerbook=a;} void writehistory(); void readhistory(fstream&); private: fstream readerbook; }; class Liberian; void Find(fstream&); void CreateTxt(fstream&); class Reader { friend Liberian; public: Reader(fstream&); void print(); void handlebook(fstream&); void change(); bool findreader(); void Addreader(); void deletereader(); private: fstream file; Person person; }; class Liberian { public: Liberian(char *,char *); void changeReader(Reader&); void selfprint(); void Append(fstream&); private: char workname[20]; char worknumber[20]; }; int main() { fstream bookRecord(" book。
    dat",ios::in| ios::out); if(!bookRecord) { cerr>choice; switch(choice) { case 1: { cout>key; switch(key) { case 1: liberian。
    Append(bookRecord); break; case 2: angeReader(reader); break; case 3: adhistory(readerRecord); case 0: break ; } } break; case 2: { cout>key; switch(key) { case 1: reader。
    handlebook(bookRecord); break; case 2: ange(); break; case 0: break; } } break; default: return 0; } } return 0; } //增加书籍 void Liberian::Append(fstream& storef) { bookData book; int choice; int key; int num; ekp(0,ios::end); int posEnd= lp(); cout>choice; switch(choice) { case 1: cout> oknumber>> okname>> ore; storef。
    write(reinterpret_cast(&book),sizeof(bookData)); break; case 2: ekg(0,ios::beg); cout>key; do{ ad(reinterpret_cast(&book),sizeof(bookData)); }while( oknumber!=key&& lg()!=posEnd); if( oknumber==key) { cout>num; if(num>0) ore+=num; else { cout(&book),sizeof(bookData)); cout>choice; switch(choice) { case 1: ekg(0,ios::beg); cout>key; do{ ad(reinterpret_cast(&book),sizeof(bookData)); }while( oknumber!=key&& lg()!=posEnd); if( oknumber==key) cout(&book),sizeof(bookData)); cout=3) return; } //cout>choice; switch(choice) { case 1: { ekp(0,ios::end); int posEnd= lp(); if( unt>key; ekg(0); do{ ad(reinterpret_cast(&book),sizeof(bookData)); }while( oknumber!=key&& lp()!=posEnd); //cout0) { person。
    Rbook[ unt]=book; unt+=1; ore-=1; ekp(-long(sizeof(bookData)),ios::cur); filee。
  write(reinterpret_cast(&book),sizeof(bookData)); cout0) //{ int iflag=0; ekg(0); cout>key; for(int i=0;i(&book),sizeof(bookData)); }while( oknumber!=key&& lp()!=posEnd); if( oknumber==key) { ore+=1; ekp(-long(sizeof(bookData)),ios::cur); filee。
    write(reinterpret_cast(&book),sizeof(bookData)); cout=3) return; } cout>choice; switch(choice) { case 1: cout>newname; strcpy( ,newname); break; case 2: cout>newnumber; strcpy( udynumber,newnumber); break; default: break;; } ekp(-long(sizeof(Person)),ios::cur); file。
    write(reinterpret_cast(&person),sizeof(Person)); cout>choice; switch(choice) { case 1: a。
  Addreader(); break; case 2: letereader(); break; case 0: return; } } void Reader::Addreader() { Person temp;bookData book={0,"0",0}; ekp(0,ios::end); int Posend= lp(); cout> ; cout> udynumber; temp。
    Rbook[1]=book; temp。Rbook[0]=book; unt=0; file。write(reinterpret_cast(&temp),sizeof(Person)); cout>name; ekg(0); do{ ad(reinterpret_cast(&person),sizeof(Person)); }while(strcmp(name, )&& lp()!=Posend); if(!strcmp(name, )) { bookData blankbook={0,"0",0}; Person guest={"0","0",0,{{0,"0",0},{0,"0",0}}}; ekp(-long(sizeof(Person)),ios::cur); file。
    write(reinterpret_cast(&guest),sizeof(Person)); cout>name; ekg(0); do{ ad(reinterpret_cast(&person),sizeof(Person)); }while(strcmp(name, )&& lp()!=Posend); if(!strcmp(name, )) { cout(&guest),sizeof(Person)); if(strcmp(guest。
    Rbook[1]。bookname,name) || strcmp(guest。Rbook[1]。bookname,name)) { cout<< <<" "<< udynumber<<" "<< unt<<" "; for(int i=0;i<2;i++) if(strcmp(guest。
    Rbook[i]。bookname,name)) cout<<guest。Rbook[i]。bookname; iflag=0; } }while( lp()!=Posend); if(iflag) cout<<"没有读者借阅图书!"<<endl; } 。
    。

2009-05-08

153 0
那就别用 c语言了 用vf就可以了

类似问题换一批

热点推荐

热度TOP

相关推荐
加载中...

热点搜索 换一换

电脑/网络
软件
硬件
电脑装机
程序设计
互联网
操作系统/系统故障
笔记本电脑
反病毒
百度
软件
软件
多媒体软件
系统软件
办公软件
网络软件
图像处理软件
举报
举报原因(必选):
取消确定举报