| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1625 人关注过本帖
标题:图书管理系统如何建立.
只看楼主 加入收藏
xinxue
Rank: 1
等 级:新手上路
帖 子:128
专家分:0
注 册:2006-2-28
收藏
 问题点数:0 回复次数:4 
图书管理系统如何建立.

建立一图书管理系统,该系统包括下面几部分:
1.图书资料库:每本图书信息为:书编号,书名,作者,出版社,数量(总数,库存数).
2.图书录入部分.新购图书加入到图书资料库链表末端.
3.图书删除部分,按书名删除该书全部信息.
4.图书查找部分,按书名查找并显示该书信息.
想了几天了,没有思路,请各位高手来帮忙解决.谢了.

搜索更多相关主题的帖子: 图书管理系统 书名 资料库 链表 库存 
2006-07-01 07:47
winterscry
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-2-28
收藏
得分:0 

使用二进制文件方式存储数据,系统以菜单方式工作
图书管理信息中包括:
1、新进图书基本信息的输入。
2、图书基本信息的查询。
3、对撤消图书信息的删除。
4、为借书人办理注册。
5、办理借书手续。
6、办理还书手续。

机会难得,不要放弃。过程和结果同样重要。呵呵


*/*******************************************************
* *
* PROJECT: GANG XIAN ZHONG XUE LIBRARY MASTE SYSTEM *
* DESIGER: AMOS *
* YEAR: 2005 *
* MONTH: 4 *
* DATE: 27 *
* *
*********************************************************
*/
#include <malloc.h>
#include<stdio.h>
#include<math.h>
#define kl 2
#define LEN sizeof(struct AMOS)


struct AMOS
{
long num;
char username[7];
char password[16];
char realname[7];
char age[3];
char sex[2];
char brithday[8];
char address[7];
struct AMOS *next;
};
struct AMOS user[kl];
int add(struct AMOS *head)
{
int k;
struct AMOS *x;
k=1;
if(head==NULL)
{
k=0;goto end;
}x=head->next;
while(x!=NULL)
{k=k+1;x=x->next;}
end:
return(k);
}
struct AMOS action(struct AMOS *head)
{
long b;
printf("WELCOME TO YOUR USER SPACE!!!\n");
printf("***WHAT WILL YOU DO???***\n***BRORROW...4***\n***RETURN...5***\n***CHANGE...6***\n***BACK...7***\n");
scanf("%d",&b);
if(b==6);

}

void PRINTL(struct AMOS *head)
{
struct AMOS *v;
int h=0;
h=add(head);
printf("THERE ARE %d USERS IN THIS SYSTEM!\n");
v=head;
if(head!=NULL)
do
{
printf("NUM:");
printf("%d",v->num);
printf("USERNAME:");
puts(v->username);
printf("PASSWORD:");
puts(v->password);
printf("REALNAME:");
puts(v->realname);
printf("SEX:");
puts(v->sex);
printf("AGE:");
puts(v->age);
printf("BRITHDAY:");

puts(v->brithday);
printf("ADDRESS:");
puts(v->address);
v=v->next;
}while (v->next=NULL);
}
struct AMOS* detele(struct AMOS *head, long num)
{
struct AMOS *m,*n;
if(head==NULL)
{
printf("\n THIS USER IS NULL!\n");
goto end;
}
m=head;
while (num!=m->num&&m->next!=NULL)
{
n=m;
m=m->next;
}
if(num==m->num)
{
if(m==head)
head=m->next;
else n->next=m->next;
printf("THIS USER HAS BEEN DELETE!\n");
}
else
printf(" CANNOT FIND SUCH A USER!\n");
end:
return(head);
}
struct AMOS master(struct AMOS *head)
{
int r,u;
long o;
struct AMOS *g;
goback:
printf("WELCOME TO YOUR MASTER SPACE!!!\n");
printf("WHAT WILL YOU DO?\n---VISTE UAERS....1\n DELETE USERS....2\nBACK....3\n");
scanf("%d",&r);
if(r==1)
{
printf("WHICH USER WILL YOU WANT TO VISTE???\nALL...1\nSINGEL...2\n");
scanf("%d",&u);
if(u==1)
PRINTL(head);
if(u==2)
{
printf("PLAESE ENTER THE NUM OF THE USER!!!\n");
scanf("%d",&o);
g=head;
while(head!=NULL)
{

if(o==g->num)
{
printf("%ld",g->num);
puts(g->username);
puts(g->password);
puts(g->realname);
puts(g->sex);
puts(g->age);
puts(g->brithday);
puts(g->address);

g=g->next;
printf("\n\n\n");
}
else
printf("CANNOT FIND THIS USER!!!\n");
}
}
}
if(r==2)
{
printf("WHICH USER WILL YOU WANT TO DELETE???\n");
scanf("%ld",&o);
detele(head,o);
}
else
{
printf("ERROR!!!\n");
goto goback;
}
if(r==3)
printf("WAITING...");


}


void insert(struct AMOS *head,struct AMOS user[])
{
struct AMOS *f,*z;
f=head;
z=user;
if(head->next==NULL)
f->next=z;
else
while (f->next!=NULL)
f=f->next;
if(f->next==NULL)
f->next=z;
}


struct AMOS* creat()
{
struct AMOS *p,*head;
p=(struct AMOS*)malloc(LEN);
printf("Please input some information about youself!\n");
printf("NUM:");
scanf("%ld",&p->num);
printf("MASTERNAME:");
scanf("%s",&p->username);
printf("PASSWORD:");
gets(p->password);
printf("REALNAME:");
gets(p->realname);
printf("SEX:");
gets(p->sex);
printf("AGE:");
gets(p->age);
printf("BRITHDAY:");
gets(p->brithday);
printf("ADDRESS:");
gets(p->address);
printf("PLEASE WAIT A LITTLE!");
printf("CONGREATLOUS! YOU HAVE BEEN THE MASTER!");
head=p;
p=head->next=NULL;
return (head);
}

void load(struct AMOS *head)
{
struct AMOS *j,*c;
char a,b[7],v[6];
int s=0;
c=head;
printf("WELCOME TO GANGXIAN ZHONG XUE LIBRARY!\n");
printf("WHAT WILL YOU DO?\n");
printf("LOAD--->:L\n\nJOIN--->PRESS:J\n\n");
scanf("%c",&a);
if(a=='L')
{
printf("PLEASE INPUT YOUR USER NAME!\nUSER NAME:");
gets(b);
while (c!=NULL)
c=c->next;
if(b!=c->username)
printf("USER NAME ERROR!\n");
else
{
printf("PLEASE INPUT YOUR PASSWORD!\nPASSWORD:");
gets(v);
while (c!=NULL)
c=c->next;
if(v!=c->password)
printf("PASSWORD ERROR!\n");
else
{
printf("WELCOME TO YOUR USER SPACE!\n");
action(head);
}
}

}
else
{
s=add(head);
s++;
printf("PLEASE ENTER YOUR NEW USER NAME!----(1-6 num or letters)\nUSER NAME:");
gets(user[s].username);
printf("PLEASE ENTER THE PASSWORD OF YOUR USER!---(6-16 num or letters)\nPASSWORD:");
gets(user[s].password);
printf("ARE YOU SURE? PLEASE REPEAT IT!\nPASSWORD:");
gets(user[s].password);
printf("PLEASE EATER YOUR REAL NAME!\nREALNAME:");
gets(user[s].realname);
printf("PLEASE EATER YOUR AGE!\nAGE:");
gets(user[s].age);
printf("PLEASE ENTER YOUR SEX!\nSEX:");
gets(user[s].sex);
printf("PLEASE ENTER YOUR BRITHDAY!---(year,month,date0\nBRITHDAY:");
gets(user[s].brithday);
printf("PLEASE ENTER YOUR ADDRESS!---(Class, grade...)\nADDRESS:");
gets(user[s].address);
printf("PLEASE WAIT A LITTLE........");
printf("CONGRAEATLEIOUES! YOU HAVE SUCCEEFULLY IN JOINING OUR LIBRARY!!!");
j=user+s;
insert(head,j);
action(head);
}

}


int main()
{
char c,a[6],b[16];
struct AMOS *head;
printf("WELCOME TO THIS LIBRARY MASTE SYSTEM!!!");
head=creat();
printf("WELCOME TO THIS LIBRARY MASTE SYSTEM!!!");
printf("PLEASE CHOCE THE SHENGFENG\nMASTER--->M\nVISTER--->v\n");
scanf("%c",&c);
if(c=='M')
{
printf("PLEASE ENTER YOUR MASTER NAME!!!\nMASTER:");
gets(a);
if(head->username!=a)
{
printf("MASTERNAME ERROR!!!\n");
load(head);
}
else
{printf("INPUT YOUR PASSWORD!!!\nPASSWORD:");
gets(b);
if(head->password!=b)
{
printf("PASSWORD ERROR!!!");
load(head);
}
else
master(head);
}
}
}

2006-07-01 21:38
–★–
Rank: 3Rank: 3
等 级:新手上路
威 望:6
帖 子:1512
专家分:0
注 册:2006-5-1
收藏
得分:0 
捧出一坛陈年老酒
(2005-4-27的作品),
可惜楼主似乎下线了

落霞与孤鹜齐飞,秋水共长天一色! 心有多大,路有多宽。三教九流,鸡鸣狗盗。兼收并蓄,海纳百川。
2006-07-01 21:57
xinxue
Rank: 1
等 级:新手上路
帖 子:128
专家分:0
注 册:2006-2-28
收藏
得分:0 

谢谢了。小鱼儿。

2006-07-02 19:31
yushui
Rank: 3Rank: 3
等 级:论坛游民
威 望:7
帖 子:1355
专家分:22
注 册:2006-7-19
收藏
得分:0 

教教我啊 我不会弄啊


fighting!from now on!
2006-07-19 11:55
快速回复:图书管理系统如何建立.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022591 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved