手机销售管理系统的编写目的?

149 2024-02-24 17:12

一、手机销售管理系统的编写目的?

编写的目的是有助于手机销售管理系统的完善和提升。

二、C++可以编写哪些手机系统的软件?

C4droidC4droid是一个C / C + + IDE + C / C + +编译器,GNU Makefile文件,SDL和Qt支持的Android。 C4droid支持ARM处理器(而不是设备与英特尔的x86和MIPS处理器)的设备。您可以创建自己的应用程序在Android手机中,运行(即使没有上网:编译器为离线状态)和出口的可执行文件(为终端的应用程序)或APK(GUI使用的应用程序)。

此应用程序使用TCC和uClibc(GCC仿生libc的一个插件),所以它有完整的ANSI C和ISO C99支持。 C4droid可用于教育目的或在C和C + +语言的练习。C4droid支持语法高亮,代码完成和源代码格式,所以它是一个非常方便的工具,在旅途中进行编程。

三、C语言编写图书管理系统的代码怎么编写?

时间在流去,我们在长大。

嗨,这里是狐狸~~

今天是2022年的一月四日了,元旦小长假也过去了,新年新气象,新年新目标,我们要向前看,不要执意过去了,感谢过去,把握现在,展望未来,这是我们现在应该做的。好了,废话不多说,今天我们分享一个系统,确实也有许久没有分享过系统了,今天就给大家详细讲一下这个图书管理系统吧。

主要内容

开发一个图书信息管理系统,图书信息包括:图书编号、书名、作者、出版社、类别、出版时间、价格等基本信息(也可以根据自己情况进行扩充,比如是否借出、库存量等)。使之能提供以下基本功能:

(1)图书信息录入功能(图书信息用文件保存)--输入

(2)图书信息浏览功能--输出

(3)查询功能(至少一种查询方式)、排序功能(至少一种排序方式):

①按书名查询

②按作者名查询 按照价钱排序 按出版时间排序等等

(4)图书信息的删除与修改

扩展功能:可以按照自己的程度进行扩展。比如

(1)简单的权限处理

(2)报表打印功能

(3)甚至根据自己情况,可以加上学生信息,并扩充为图书借阅系统。

(4)模糊查询

(5)综合查询

(6)统计功能 比如统计处某一类别的图书信息 或 筛选出小于指定数量库存的图

书信息等等。

概要设计

1 图书录入可以录入图书名,作者,出版社,出版日期,价格!录入图书编号时函数就会判断此编号是否存在,若

存在不能成功录入!

2 图书浏览可以浏览全部图书!

3 图书查询提供按图书编号模糊查询,按图书名关键字查询,按图书编号精确查询,按图书名精确查询!模糊查询

和关键字查询事通过比价字符串的相似度而实现的!

4 修改删除图书可以通过图书查询来查询操作的图书编号,通过编号操作!函数会提示用户是否调用图书查询来找

到自己想要操作的图书的编号。如果某一本图书已经被借阅那么用户就不能删除该图书!

5 借阅图书通过学号和图书编号进行借阅!如果该学号是第一次借阅那么会提示用户输入自己的姓名,并存入

student.txt,方便以后借阅与归还!

6 归还图书先提供学号,然后程序会输出该学号借阅的所有图书,然后再通过编号归还!

7 借阅查询可查询某个学生已借但未归还的图书!

项目源码

结构体

先建立结构体,定义结构体成员

typedef struct book/*图书结构体*/
{
char num[10];  /*书号*/
char name[10];  /*书名*/
char auth[10]; /*作者*/
int count;
int sum;
}Book;
typedef struct borrow/*借书结构体*/
{
char id[20];
char user[20];
char book[20];
char bookid[20];
struct borrow *next;
}BBnode,*BBlink;
struct user 
{ 
char num[10];/* 学号 */ 
char pass[15];
char name[15]; 
char sex[10]; 

}; 

typedef struct unode 
{ 
struct user data; 
struct unode *next; 
}Unode,*Ulink; 
Unode *os;

登录界面函数

int login(Ulink l)
{
 

/*****************登陆窗口初始化****************************/
while(!flag)
{
char User_id[10],password[10],tmp;
int i=0;
User_id[0]='\0';
password[0]='\0';
textbackground(179);
clrscr();
gotoxy(33,23);
textcolor(YELLOW);
cputs("ESC = EXIT");
textcolor(WHITE);
textbackground(179);
box(1,1,80,24);
h_line(2,3,78);
gotoxy(15,2);
cputs("Login now please input the User__ID  and Password");
bar_(30,10,23,5,5);
/******************账号过滤*********************/
while(User_id[0]=='\0')
{
gotoxy(31,11);
textcolor(YELLOW);
textbackground(5);
cputs("User__ID:");
gotoxy(31,13);
cputs("Password:");
textbackground(179);
textcolor(WHITE);
gotoxy(28,7);
cputs("please input the User__ID!");
textbackground(179);
textcolor(YELLOW);
gotoxy(27,11);
putch(272);
gotoxy(27,13);
putch(' ');
gotoxy(40,11);
tmp=getch();
if(tmp==27)
{
flg=27;
return 0;
}
while(tmp!='\r'&&i<=9&&(tmp>=64&&tmp<=90)||(tmp>=97&&tmp<=122||(tmp>=48&&tmp<=57)))
{
textcolor(YELLOW);
textbackground(5);
	putch(tmp);
	User_id[i]=tmp;
	i++;
	tmp=getch();
	if(tmp==27)
	{
flg=27;
return 0;
}
}
User_id[i]='\0';
}
/**********************密码过滤****************************/
while(password[0]=='\0')
{
gotoxy(28,7);
textbackground(179);
textcolor(WHITE);
cputs("  input the password now  ");
textbackground(179);
textcolor(YELLOW);
gotoxy(27,13);
putch(272);
gotoxy(27,11);
putch(' ');
gotoxy(40,13);
i=0;
tmp=getch();
if(tmp==27)
{
flg=27;
return 0;
}
while(tmp!='\r'&&i<=10&&(tmp>=64&&tmp<=90)||(tmp>=97&&tmp<=122||(tmp>=48&&tmp<=57)))
{
	textbackground(5);
	putch('*');

	password[i]=tmp;
	i++;
	tmp=getch();
	if(tmp==27)
	{
flg=27;
return 0;
}
}
password[i]='\0';
}
/*************把账号和密码进行对比验证**************/
if(!strcmp(User_id,"admin")&&!strcmp(password,"admin"))
	{
		return 2;
	}
if(cmps(l,User_id,password))
{	 
	return 1;
}
}
}

选择界面函数

void choose()
{
while(1)
{

textbackground(179);
clrscr();
gotoxy(33,2);
textcolor(WHITE);
cputs("Administrastor");
textcolor(YELLOW);
box(1,1,80,24);
h_line(2,3,78);
gotoxy(3,6);
cputs(">>>-------------------------1.User Management----------------------------<<<");
gotoxy(3,10);
cputs(">>>-------------------------2.Book Management----------------------------<<<");
	gotoxy(3,14);
cputs(">>>-------------------------3.Borrow Books-------------------------------<<<");
gotoxy(30,22);
textcolor(RED);
cputs("Please Select!!!");
flg=getch();
if(flg=='2')		
	bookss();									
if(flg=='1')
	users();
if(flg=='3')
	borrow();
if(flg==27)
{
	flg=-1;
	return;
}	
}		
}
void admin()
{
while(1)
{
choose();	
if(flg=='1')	
bookss();
if(flg=='2')
users();
if(flg=='3')
borrow();
if(flg==27)
{
return;
}
}
}

操作界面函数

void user(Ulink h)
{
int flag;
BBlink l,p,r;/* 连表 */ 
FILE *fp; /* 文件指针 */ 
int count=0; 
l=(BBnode*)malloc(sizeof(BBnode)); 
l->next=NULL; 
r=l; 
fp=fopen(bfile,"rb"); 
if(fp==NULL) 
{ 
	fp=fopen(bfile,"wb"); 
} 
while(!feof(fp)) 
{
	p=(BBnode*)malloc(sizeof(BBnode)); 
	if(fread(p,sizeof(BBnode),1,fp)) /* 将文件的内容放入接点中 */ 
	{ 
		p->next=NULL; 
        r->next=p; 
        r=p; /* 将该接点挂入连中 */ 
        count++; 
    } 
} 
	while(1) 
{	
	textbackground(179);
	clrscr();
	textcolor(YELLOW);
	box(1,1,80,24);
	h_line(2,3,78);
	gotoxy(3,2);
	textcolor(RED);
	cputs("A.");
	textcolor(BLUE);
	cputs("my message  ");
	textcolor(RED);
	cputs("B.");
	textcolor(BLUE);
	cputs("modyfy my message  ");
	textcolor(RED);
	cputs("C.");
	textcolor(BLUE);
	cputs("my borrow  ");
	textcolor(RED);
	cputs("D.");
	textcolor(BLUE);
	cputs("search book");
	textcolor(YELLOW);
	gotoxy(50,50);
	flag=getch(); 
    switch(flag)		
	{ 		
	case 'a':
		show(os);
		
		break; /*************添加用户**********/
	case 'b':
		Modify_user(h);
		Save(h);
		
		break;/*************删除用户**********/
	case 'c':
		Myborrow();
		break;
	case 'd':
		usersearch();

		
		break;
	case 27:
		return;
		
	} 

} 

}

添加函数

图书的添加,包括用户添加以及管理员添加

 void add(blink l)
{ 
Bnode *p,*r,*s; 
char num[10]; 
r=l; 
s=l->next; 
while(r->next!=NULL) 
	r=r->next; 
textcolor(RED);
gotoxy(25,4);
cputs("INPUT THE MESSAGE ABOUT BOOK");
gotoxy(31,10);
textcolor(YELLOW);
cputs("Book ID:");
scanf("%s",num); 
p=(Bnode *)malloc(sizeof(Bnode));  
while(s) 
{ 
	if(strcmp(s->data.num,num)==0) 
	{ 
		textcolor(WHITE);
		gotoxy(25,15);
		cputs("This ID:");
		printf("'%s'",num); 
		cputs("is exist!");    
		gotoxy(25,22);
		cputs("please Press any key to continue...");  
		gotoxy(255,252);
		getch();                    
		return; 
	} 
	s=s->next; 
} 
strcpy(p->data.num,num); 
gotoxy(31,12);
textcolor(YELLOW);
cputs("Input Book name:"); 
scanf("%s",p->data.name); 
gotoxy(31,14);
cputs("input your Book auth:"); 
scanf("%s",p->data.auth); 
gotoxy(31,16);
cputs("input your Book count:"); 
scanf("%d",&p->data.count); 
bookcount=p->data.count+bookcount;
p->data.sum=0;
p->next=NULL; 
r->next=p; 
r=p; 
gotoxy(30,22);
textcolor(RED);
cputs("Add Book Success !!!");
getch();
textcolor(YELLOW);
} 

 /*******管理员添加用户*******/
void Add(Ulink l)
{ 
Unode *p,*r,*s; 
char num[10]; 
r=l; 
s=l->next; 
while(r->next!=NULL) 
	r=r->next; 
textcolor(RED);
gotoxy(25,4);
cputs("INPUT THE MESSAGE ABOUT BOOK");
gotoxy(31,10);
textcolor(YELLOW);
cputs("User ID:");
scanf("%s",num); 
p=(Unode *)malloc(sizeof(Unode));  
while(s) 
{ 
	if(strcmp(s->data.num,num)==0) 
	{ 
		gotoxy(25,15);
		cputs("This ID:");
		printf("'%s'",num); 
		cputs("is exist!");    
		gotoxy(25,22);
		textcolor(RED);
		cputs("please Press any key to continue...");  
		gotoxy(255,252);
		getch();                    
		return; 
	} 
	s=s->next; 
} 
strcpy(p->data.num,num); 
gotoxy(31,12);
textcolor(YELLOW);
cputs("Input Password:"); 
scanf("%s",p->data.pass); 
gotoxy(31,14);
cputs("input your name:"); 
scanf("%s",p->data.name); 
gotoxy(31,16);
cputs("input the sex:"); 
scanf("%s",p->data.sex); 
p->next=NULL; 
r->next=p; 
r=p; 
gotoxy(30,22);
cputs("Add User Success !!!");
usercount++;
getch();
textcolor(YELLOW);
} 

查找函数

用户查找以及管理员查找

 /*******管理员查找图书*******/
void qur(blink l)
{ 
int sel; 
char findmess[20]; 
Bnode *p; 

if(!l->next) 
{ 
gotoxy(30,4);
textcolor(WHITE);
     cputs("Not Find Bookdata!!!"); 
	 getch();
    return; 
} 
textcolor(RED);
gotoxy(25,4);
cputs("Please Select Search  Type !");
gotoxy(10,8);
textcolor(WHITE);
cputs("1.Search by ID");
gotoxy(10,10);
cputs("2.Search by Name");
gotoxy(10,12);
cputs("Please Select 1 or 2:");
scanf("%d",&sel); 
if(sel==1) 
{
	gotoxy(36,8);
	textcolor(YELLOW);
	cputs("Input the search ID:"); 
	scanf("%s",findmess); 
	p=locate(l,findmess,"num"); 
	if(p) 
	{ 
		gotoxy(36,12);
		textcolor(WHITE);
		cputs("Book ID:");
		printf("%s",p->data.num);
		gotoxy(36,14);
		textcolor(WHITE);
		cputs("Book Name:");
		printf("%s",p->data.name);
		gotoxy(36,16);
		textcolor(WHITE);
		cputs("Book author:");
		printf("%s",p->data.auth);
		gotoxy(36,18);
		textcolor(WHITE);
		cputs("Book count:");
		printf("%d",p->data.count);
		getch();
		textcolor(YELLOW);
		gotoxy(30,21);
		cputs("Search Success !!");
	}
	else 
	{
		gotoxy(30,22);
		textcolor(RED);
		cputs("Not finde !!!"); 
		getch();
	}
}	
else if(sel==2) /* 姓名 */
{ 
	gotoxy(36,8);
	textcolor(YELLOW);
	cputs("Input the search name:");
	scanf("%s",findmess); 
	p=locate(l,findmess,"name"); 		
	if(p) 
	{ 
		gotoxy(36,12);
		textcolor(WHITE);
		cputs("Book ID:");
		printf("%s",p->data.num);
		gotoxy(36,14);
		textcolor(WHITE);
		cputs("Book Name:");
		printf("%s",p->data.name);
		gotoxy(36,16);
		textcolor(WHITE);
		cputs("Book author:");
		printf("%s",p->data.auth);
		gotoxy(36,18);
		textcolor(WHITE);
		cputs("Book count:");
		printf("%d",p->data.count);
		getch();
		textcolor(YELLOW);
	} 
	else 
	{
		textcolor(RED);
		gotoxy(30,22);
		cputs("Not finde !!!"); 
	}
} 
else 
{
	textcolor(RED);
	gotoxy(30,22); 
	cputs("Error !!"); 
	getch();
}
} 

/*******用户查找图书*******/
void usersearch()
{ 
int sel; 
char findmess[20]; 
Bnode *p; 
blink l;/* 连表 */ 
FILE *fp; /* 文件指针 */ 
int count=0; 
Bnode *P,*r;
l=(Bnode*)malloc(sizeof(Bnode)); 
l->next=NULL; 
r=l; 
fp=fopen(file,"rb"); 
if(fp==NULL) 
{ 
	fp=fopen(file,"wb"); 
 } 
while(!feof(fp)) 
{ 
    P=(Bnode*)malloc(sizeof(Bnode)); 
    if(fread(P,sizeof(Bnode),1,fp)) /* 将文件的内容放入接点中 */ 
    { 
        P->next=NULL; 
		bookcount=bookcount+P->data.count;
		booksum=booksum+P->data.sum;
        r->next=P; 
        r=P; /* 将该接点挂入连中 */ 
        count++; 
    }
} 
fclose(fp); /* 关闭文件 */ 


if(!l->next) 
{ 
gotoxy(30,4);
textcolor(WHITE);
     cputs("Not Find Bookdata!!!");
	 getch();
    return; 
} 
textcolor(RED);
gotoxy(25,4);
cputs("Please Select Delete  Type !");
gotoxy(10,8);
textcolor(WHITE);
cputs("1.Search by ID");
gotoxy(10,10);
cputs("2.Search by Name");
gotoxy(10,12);
cputs("Please Select 1 or 2:");
scanf("%d",&sel); 
if(sel==1) 
{
	gotoxy(36,8);
	textcolor(YELLOW);
	cputs("Input the search ID:"); 
	scanf("%s",findmess); 
	p=locate(l,findmess,"num"); 
	if(p) 
	{ 
		gotoxy(36,12);
		textcolor(WHITE);
		cputs("Book ID:");
		printf("%s",p->data.num);
		gotoxy(36,14);
		textcolor(WHITE);
		cputs("Book Name:");
		printf("%s",p->data.name);
		gotoxy(36,16);
		textcolor(WHITE);
		cputs("Book author:");
		printf("%s",p->data.auth);
		gotoxy(36,18);
		textcolor(WHITE);
		cputs("Book count:");
		printf("%d",p->data.count-p->data.sum);
		getch();
		textcolor(YELLOW);
	}
	else 
	{
		gotoxy(30,22);
		textcolor(RED);
		cputs("Not finde !!!"); 
		getch();
	}
}	
else if(sel==2)
{ 
	gotoxy(36,8);
	textcolor(YELLOW);
	cputs("Input the search name:");
	scanf("%s",findmess); 
	p=locate(l,findmess,"name"); 		
	if(p) 
	{ 
		gotoxy(36,12);
		textcolor(WHITE);
		cputs("Book ID:");
		printf("%s",p->data.num);
		gotoxy(36,14);
		textcolor(WHITE);
		cputs("Book Name:");
		printf("%s",p->data.name);
		gotoxy(36,16);
		textcolor(WHITE);
		cputs("Book author:");
		printf("%s",p->data.auth);
		gotoxy(36,18);
		textcolor(WHITE);
		cputs("Book count:");
		printf("%d",(p->data.count-p->data.sum));
		getch();
		textcolor(YELLOW);
	} 
	else 
	{
		textcolor(RED);
		gotoxy(30,22);
		cputs("Not finde !!!"); 
	}
} 
else 
{
	textcolor(RED);
	gotoxy(30,22); 
	cputs("Error !!"); 
	getch();
}
} 

/*******图书查找*******/
int cmpbook(blink l,char id[],char na[])
{ 
char findm[20];
Bnode *p; 
if(!l->next) 
{ 
	gotoxy(25,4);
	textcolor(RED);
     cputs("Not Find Book!!!"); 
	 getch();
    return 0; 
} 
strcpy(findm,id);
	p=locate(l,findm,"num"); 
	if(p) 
	{ 
		strcpy(findm,na);
		p=locate(l,findm,"name"); 		
		if(p) 
		{ 
			return 1;	
		} 
		else 
		{
			textcolor(RED);
			gotoxy(30,22);
			cputs("Book name is NULL !!!"); 
			getch();
			return 0;
		}
	}
	else 
	{
		gotoxy(30,22);
		textcolor(RED);
		cputs("Book id is NULL !!!"); 
		getch();
		return 0;
	}	

} 

删除函数

图书的删除

void del(blink l) 
{ 
	int sel; 
	Bnode *p,*r; 
	char findmess[20]; 
	if(!l->next) 
	{ 
		gotoxy(25,4);
		textcolor(RED);
		cputs("=====>not thing could delete!\n"); 
		getch();
		return; 
	} 
	textcolor(RED);
	gotoxy(25,4);
	puts("Please Select Delete  Type !");
	gotoxy(10,8);
	
	textcolor(WHITE);
	cputs("1.Delete by Book ID");
	gotoxy(10,10);
	cputs("2.Delete by Book Name");
	gotoxy(10,12);
	cputs("Please Select 1 or 2:");
	scanf("%d",&sel); 
	if(sel==1)     
	{ 
		gotoxy(36,8);
		textcolor(YELLOW);
		cputs("Input the delete ID:"); 
		scanf("%s",findmess); 
		p=locate(l,findmess,"num"); 
		if(p) 
		{ 
			bookcount=bookcount-p->data.count;
			r=l; 
			while(r->next!=p) 
				r=r->next; 
			r->next=p->next; 
			free(p); 
			gotoxy(30,22);
			textcolor(RED);
			cputs("Delete success!\n");     
			textcolor(YELLOW);  
		} 
		else 
		{
	textcolor(RED);
	gotoxy(30,22); 
	cputs("Error !!"); 
		}
	} 
	else if(sel==2) 
	{ 
		gotoxy(36,8);
		textcolor(YELLOW);
		cputs("Input the delete name:"); 
		scanf("%s",findmess); 
		p=locate(l,findmess,"name"); 
		if(p) 
		{ 
			r=l; 
			while(r->next!=p) 
				r=r->next; 
			r->next=p->next; 
			free(p); 
			gotoxy(30,22);
			textcolor(RED);
			cputs("Delete success!\n"); 
			bookcount--;
			textcolor(YELLOW);  
		} 
		else
		{
			gotoxy(25,18);
			cputs("Not find!!"); 
		}
	} 
	else
	{
	textcolor(RED);
	gotoxy(30,22); 
	cputs("Error !!");  
	}
	getch();
	textcolor(YELLOW);
} 

借书管理函数

void borrow()
{
while(1)
{
int flag;
BBlink l,p,r;/* 连表 */ 
FILE *fp; /* 文件指针 */ 
int count=0; 
l=(BBnode*)malloc(sizeof(BBnode)); 
l->next=NULL; 
r=l; 
fp=fopen(bfile,"rb"); 
if(fp==NULL) 
{ 
	fp=fopen(bfile,"wb"); 
} 
while(!feof(fp)) 
{
	p=(BBnode*)malloc(sizeof(BBnode)); 
	if(fread(p,sizeof(BBnode),1,fp)) /* 将文件的内容放入接点中 */ 
	{ 
		p->next=NULL; 
        r->next=p; 
        r=p; /* 将该接点挂入连中 */ 
        count++; 
    } 
	borrowcount=count;
} 
while(1) 
{	
	textbackground(179);
	clrscr();
	textcolor(YELLOW);
	box(1,1,80,24);
	h_line(2,3,78);
	gotoxy(3,2);
	textcolor(RED);
	cputs("B");
	textcolor(BLUE);
	cputs("orrow book  ");
	textcolor(RED);
	cputs("R");
	textcolor(BLUE);
	cputs("eturn book  ");
	textcolor(RED);
	cputs("S");
	textcolor(BLUE);
	cputs("earch borrow  ");
	textcolor(YELLOW);
	printf("count: (borrow=%d)",borrowcount);
	textcolor(RED);
	gotoxy(50,50);
	flag=getch(); 
    switch(flag)		
	{ 		
	case 'b':
		Add_borrow(l);
		
		break; /*************添加用户**********/
	case 'r':
		Del_borrow(l);
		Save_borrow(l);
		break;
	case 's':
		Qur_borrow(l);
		break;
	case 27:
		return;
		
	} 
} 	
}
}

信息储存函数

图书信息的储存

*******借书信息保存*******/
void Save_borrow(BBlink l) 
{ 
 FILE* fp; 
 BBnode *p; 
 int flag=1,count=0; 
 fp=fopen(bfile,"wb"); 
 if(fp==NULL) 
 { 
gotoxy(35,12);
	textcolor(RED);
      cputs("open error!"); 
      exit(1); 
 } 
 p=l->next; 
 while(p) 
 { 
      if(fwrite(p,sizeof(BBnode),1,fp)==1) 
      { 
          p=p->next; 
          count++; 
      } 
      else 
      { 
          flag=0; 
          break; 
      } 
} 
if(flag) 
{ 
textcolor(RED);
gotoxy(30,24);
 /*** printf("save success.(saved%d.)",count);**调试的时候用的*/
}
fclose(fp); 
} 

还书函数

 /* 还书的操作 */ 
void Del_borrow(BBlink l) 
{ 
		int sel; 
	BBnode *p,*r; 
	Bnode *L;
	char findmess[20];
	FILE *fp; /* 文件指针 */
Bnode *P,*R,*Q;
L=(Bnode*)malloc(sizeof(Bnode)); 
L->next=NULL; 
R=L; 
fp=fopen(file,"rb"); 
if(fp==NULL) 
{ 
	fp=fopen(file,"wb");
 }
while(!feof(fp))
{
    P=(Bnode*)malloc(sizeof(Bnode));
    if(fread(P,sizeof(Bnode),1,fp)) /* 将文件的内容放入接点中 */
    {
        P->next=NULL;
        R->next=P;
        R=P; /* 将该接点挂入连中 */
    }
}
fclose(fp); /* 关闭文件 */

	if(!l->next)
	{
		gotoxy(30,4);
		textcolor(RED);
		cputs("not Book could Return!\n");
		getch();
		return;
	}
	textcolor(RED);
	gotoxy(25,4);
	puts("Please Select Return  Type !");
	gotoxy(10,8);

	textcolor(WHITE);
	cputs("1.Return by Borrow ID");
	gotoxy(10,10);
	cputs("2.Return by book name");
	gotoxy(10,12);
	cputs("Please Select 1 or 2:");
	scanf("%d",&sel);
	if(sel==1)
	{
		gotoxy(36,8);
		textcolor(YELLOW);
		cputs("Input the Borrow ID:");
		scanf("%s",findmess);
		p=Locate_borrow(l,findmess,"num");
		if(p)
		{

				Q=locate(L,findmess,"num");
				if(Q) 
				{ 
					Q->data.sum=Q->data.sum-1;
						save(L);
				} 
			r=l; 
			while(r->next!=p) 
				r=r->next; 
			r->next=p->next; 
			free(p); 
			gotoxy(30,22);
			textcolor(RED);
			cputs("Return success!\n"); 
			borrowcount--;
			getch();
			textcolor(YELLOW);  
		} 
		else 
		{
			gotoxy(30,22);
			textcolor(RED);
			cputs("Note find !!"); 
			getch();
			
		}
	} 
	else if(sel==2) 
	{ 
		gotoxy(36,8);
		textcolor(YELLOW);
		cputs("Input the Book name:"); 
		scanf("%s",findmess); 
		p=Locate_borrow(l,findmess,"book");
		if(p) 
		{ 
			
				Q=locate(L,findmess,"name"); 
				if(Q) 
				{ 
					Q->data.sum=Q->data.sum-1;
						save(L);
				} 
			
			r=l; 
			while(r->next!=p) 
				r=r->next; 
			r->next=p->next; 
			free(p); 
			gotoxy(30,22);
			textcolor(RED);
			cputs("Borrow success!\n"); 
			borrowcount--;
			getch();
			textcolor(YELLOW);  
		} 
		else
		{
			gotoxy(30,18);
			textcolor(RED);
			cputs("Not find!!"); 
			getch();
		}
	} 
		
	else
	{
		gotoxy(30,22);
		textcolor(RED);
		cputs("Not finde !!"); 
		getch();
	}
	textcolor(YELLOW);
} 

修改函数

也分为用户和管理员两种情况

/* ****用于管理员修改用户资料 ***/
void Modify(Ulink l) 
{ 
	Unode *p; 
	char findmess[20]; 
	if(!l->next) 
	{
		gotoxy(30,4);
		textcolor(RED);
		cputs("not thing could modify!"); 
		getch();
		return; 
	} 
	gotoxy(30,4);
	textcolor(RED);
	cputs("Modify User Message");
	gotoxy(25,8);
	textcolor(YELLOW);
	cputs("input the User Id:");
	scanf("%s",findmess); 
	p=Locate(l,findmess,"num"); 
	if(p) 
	{ 
		textcolor(YELLOW);
		gotoxy(25,10);
		printf("Inpute The New ID(old:%s):",p->data.num); 
		scanf("%s",p->data.num); 
		gotoxy(25,12);
		printf("Input The New Password(old:%s):",p->data.pass); 
		scanf("%s",p->data.pass); 
		gotoxy(25,14);
		printf("Input The New Name(old:%s):",p->data.name); 
		scanf("%s",p->data.name); 
		gotoxy(25,16);
		printf("Input The New Sex(old:%s):",p->data.sex); 
		scanf("%s",p->data.sex); 
		gotoxy(30,20);
		textcolor(RED);
		cputs("Modify Success !!!"); 
		getch();
		textcolor(YELLOW);
	} 
	else 
	{	
		gotoxy(30,16);
		textcolor(RED);
		cputs("Not Finde !!!"); 
		getch();
	}
} 


 /****供用户修改用户自己资料 */
void Modify_user(Ulink l)
{ 
	Unode *p; 
	char findmess[20]; 
	if(!l->next) 
	{
		gotoxy(30,4);
		textcolor(RED);
		cputs("not thing could modify!"); 
		getch();
		return; 
	} 
	gotoxy(30,4);
	textcolor(RED);
	cputs("Modify User Message");
	gotoxy(33,8);
	textcolor(YELLOW);
	strcpy(findmess,os->data.num);
	printf("your id:%s",findmess);
	p=Locate(l,findmess,"num"); 
	if(p) 
	{ 
		textcolor(YELLOW);
		gotoxy(24,10);
		printf("Input The New Password(old:%s):",p->data.pass); 
		scanf("%s",p->data.pass); 
		gotoxy(24,12);
		printf("Input The New Name(old:%s):",p->data.name); 
		scanf("%s",p->data.name); 
		gotoxy(24,14);
		printf("Input The New Sex(old:%s):",p->data.sex); 
		scanf("%s",p->data.sex); 
		gotoxy(31,18);
		textcolor(RED);
		cputs("Modify Success !!!"); 
		getch();
		textcolor(YELLOW);
	} 
	else 
	{	
		gotoxy(30,16);
		textcolor(RED);
		cputs("Not Finde !!!"); 
		getch();
	}
} 

添加借书函数

/*******添加借书*******/
void Add_borrow(BBlink l) 
{ 
Ulink H;/* 连表 */ 
FILE *Fp; /* 文件指针 */ 
Unode *Q,*T;
blink L;/* 连表 */ 
FILE *FP; /* 文件指针 */ 
int ttl;

Bnode *P,*R;
char bookid[20];
char bookname[20];
char userid[20];
BBnode *p,*r,*s; 
char num[10]; 
r=l; 
s=l->next; 
while(r->next!=NULL) 
	r=r->next; 
L=(Bnode*)malloc(sizeof(Bnode)); 
L->next=NULL; 
R=L; 
FP=fopen(file,"rb"); 
if(FP==NULL) 
{ 
	FP=fopen(file,"wb"); 
 } 
while(!feof(FP)) 
{ 
    P=(Bnode*)malloc(sizeof(Bnode)); 
    if(fread(P,sizeof(Bnode),1,FP)) /* 将文件的内容放入接点中 */ 
    { 
        P->next=NULL; 
		bookcount=bookcount+P->data.count;
        R->next=P; 
        R=P; /* 将该接点挂入连中 */ 

    } 
} 
fclose(FP); /* 关闭文件 */ 


H=(Unode*)malloc(sizeof(Unode)); 
H->next=NULL; 
T=H;
Fp=fopen(ufile,"rb"); 
if(Fp==NULL) 
{ 
	Fp=fopen(ufile,"wb"); 
 } 
while(!feof(Fp)) 
{ 
    Q=(Unode*)malloc(sizeof(Unode));
    if(fread(Q,sizeof(Unode),1,Fp)) /* 将文件的内容放入接点中 */ 
    { 
        Q->next=NULL; 
        T->next=Q; 
        T=Q; /* 将该接点挂入连中 */ 
    } 
} 
fclose(Fp); 
textcolor(RED);
gotoxy(25,4);
cputs("Please input thease message");
gotoxy(30,10);
textcolor(YELLOW);
cputs("Input Borrow ID:");
scanf("%d",&ttl);
itoa(ttl,num,10) ;
p=(BBnode *)malloc(sizeof(BBnode));
while(s) 
{ 
	if(strcmp(s->id,num)==0) 
	{ 
		gotoxy(30,15);
		cputs("Borrow ID:");
		printf("'%s'",num); 
		cputs("is exist!");    
		gotoxy(26,22);
		textcolor(RED);
		cputs("please Press any key to continue...");  
		gotoxy(255,252);
		getch();                    
		return; 
	} 
	s=s->next; 
} 
strcpy(p->id,num);
gotoxy(31,12);
textcolor(YELLOW);
cputs("Input book id:"); 
scanf("%s",bookid);
gotoxy(31,14);
textcolor(YELLOW);
cputs("Input book name:"); 
scanf("%s",bookname);/***************************************图书判断在否***************************************/ 
if(cmpbook(L,bookid,bookname))
{
	strcpy(p->bookid,bookid);
	strcpy(p->book,bookname);
	gotoxy(31,16);
cputs("input your ID:"); 
scanf("%s",userid); /**************************************用户判断在否********************************/
if(cmpuser(H,userid))
{
	strcpy(p->user,userid);
	p->next=NULL; 
r->next=p; 
r=p; 
if(changeb(L,bookid))
{
gotoxy(30,22);
cputs("Borrow Success !!!");
Save_borrow(l);
borrowcount++;

getch();
}
}

}

textcolor(YELLOW);
} 
 

查找借书函数

查找自己借了哪些书

void Myborrow()
{
int i;

BBlink l,p,r;/* 连表 */ 
FILE *fp; /* 文件指针 */ 
int count=0; 
l=(BBnode*)malloc(sizeof(BBnode)); 
l->next=NULL; 
r=l; 
fp=fopen(bfile,"rb"); 
if(fp==NULL) 
{ 
	fp=fopen(bfile,"wb"); 
} 
i=6;
while(!feof(fp)) 
{


	
	p=(BBnode*)malloc(sizeof(BBnode)); 
	if(fread(p,sizeof(BBnode),1,fp)) /* 将文件的内容放入接点中 */ 
	{ 
		textcolor(WHITE);
		gotoxy(30,4);
		cputs("Your borrow book");
		
		if(strcmp(p->user,os->data.num)==0)
		{
			textcolor(YELLOW);

			gotoxy(20,i);
			printf("Borrow ID:%s\tBook id:%s\tBook name:%s",p->id,p->bookid,p->book);
			i++;

			p->next=NULL; 
			r->next=p; 
			r=p; /* 将该接点挂入连中 */ 
			count++; 
		}
    } 
	myborrow=count;
	if(myborrow==0)
	{
		textcolor(YELLOW);
		gotoxy(30,13);
		cputs("You  no borrow !!");


	}



}
fclose(fp);
textcolor(YELLOW);
	gotoxy(65,2);
	printf("(borrow=%d)",myborrow);
		
	getch();

}

借书管理函数

void borrow()
{
while(1)
{
int flag;
BBlink l,p,r;/* 连表 */ 
FILE *fp; /* 文件指针 */ 
int count=0; 
l=(BBnode*)malloc(sizeof(BBnode)); 
l->next=NULL; 
r=l; 
fp=fopen(bfile,"rb"); 
if(fp==NULL) 
{ 
	fp=fopen(bfile,"wb"); 
} 
while(!feof(fp)) 
{
	p=(BBnode*)malloc(sizeof(BBnode)); 
	if(fread(p,sizeof(BBnode),1,fp)) /* 将文件的内容放入接点中 */ 
	{ 
		p->next=NULL; 
        r->next=p; 
        r=p; /* 将该接点挂入连中 */ 
        count++; 
    } 
	borrowcount=count;
} 
while(1) 
{	
	textbackground(179);
	clrscr();
	textcolor(YELLOW);
	box(1,1,80,24);
	h_line(2,3,78);
	gotoxy(3,2);
	textcolor(RED);
	cputs("B");
	textcolor(BLUE);
	cputs("orrow book  ");
	textcolor(RED);
	cputs("R");
	textcolor(BLUE);
	cputs("eturn book  ");
	textcolor(RED);
	cputs("S");
	textcolor(BLUE);
	cputs("earch borrow  ");
	textcolor(YELLOW);
	printf("count: (borrow=%d)",borrowcount);
	textcolor(RED);
	gotoxy(50,50);
	flag=getch(); 
    switch(flag)		
	{ 		
	case 'b':
		Add_borrow(l);
		
		break; /*************添加用户**********/
	case 'r':
		Del_borrow(l);
		Save_borrow(l);
		break;
	case 's':
		Qur_borrow(l);
		break;
	case 27:
		return;
		
	} 
} 	
}
}

主函数

main()
{

Ulink h,os;/* 连表 */ 
FILE *fp; /* 文件指针 */ 
Unode *p,*r;
h=(Unode*)malloc(sizeof(Unode)); 
h->next=NULL; 
r=h; 
fp=fopen(ufile,"rb"); 
if(fp==NULL) 
{ 
	fp=fopen(ufile,"wb"); 
 } 
while(!feof(fp)) 
{ 
    p=(Unode*)malloc(sizeof(Unode)); 
    if(fread(p,sizeof(Unode),1,fp)) /* 将文件的内容放入接点中 */
    {
        p->next=NULL;
        r->next=p;
        r=p; /* 将该接点挂入连中 */

    }
}
fclose(fp);
system("wellcome");
	if(flg==27)
	{
		flg=-1;
		return;
	}
		while(1)
		{
			flag=login(h);
			if(flg==27)
				{
					flg=-1;
					break;
				}

				if(flag==2)
				{
					choose();
					flag=0;
				}
				if(flag==1)
				{
					user(h);
					flag=0;
				}
		}
}

总结

今天的代码量有点小多,难度也不小,用了大量的链表来储存数据,还有一些功能因为篇幅的问题没有放上来,总的来说,这个图书管理系统的功能是很全面的,无论从哪个角度来看。当然啦。有兴趣的同学可以进群领取完整的源码看看,绝对是一个不错的机会,可以说,你要是学会了这个系统,你的C语言在我看来就完全没有问题了,而且在数据结构一块,你也算是小成了,所以希望大家可以认真学习,争取早日掌握。

这也是2022年的第一篇文章了,希望2022继续加油,向大家分享更多有趣的、有用的知识,十分感谢大家的一路支持,后续我还会发布更多的项目源或者学习资料,希望大家可以持续关注,有什么问题可以回帖留言。想要提前掌握的可以加群领取C/C++学习资料以及其他项目的源码的可以加群【1083227756】了解。想要对程序员的未来发展有兴趣的可以关注微信公众号:【狐狸的编码时光】,希望和大家一起学习进步!

四、怎样编写考试程序系统?

软件数据库有87个试题,系统随机选取20个试题,在答题界面,点击Option1控件就可以实现答题操作,答题20个以后,【交卷】按钮有效,点击【交卷】,可以判断正确和错误试题,并将错题答案和正确答案继续对比。 如果需要源文件,提供发送地址。

五、手机编写文档的软件

手机编写文档的软件

手机编写文档的软件:提升工作效率的利器

今天,随着移动设备的普及和技术的进步,手机不再是仅仅用来打电话、发短信的东西,它们已经成为了我们生活中不可或缺的工具之一。而在手机上编写文档,包括写博客、撰写报告、编辑文稿等,也成为了我们工作中的常态。

然而,在手机上编写文档并不是一件容易的事情。小屏幕、不便利的输入方式以及有限的功能,都会给我们带来很大的困扰。因此,选择一款好用的手机编写文档的软件变得尤为重要。今天,就让我们来介绍几款优秀的手机编写文档的软件。

1. WPS Office

WPS Office 是一款功能强大、界面简洁的手机办公软件。它不仅支持文档的创建和编辑,还支持表格、演示文稿等文档类型的处理。同时,WPS Office 还提供了云端同步功能,方便我们在多台设备之间同步和共享文档。

WPS Office 的编辑功能非常出色,它提供了丰富的文字编辑工具、格式调整选项和样式设置等。而且,它的界面简洁直观,操作起来十分流畅。无论是在手机上还是平板电脑上,WPS Office 都能够提供良好的使用体验。

2. Evernote

Evernote 是一款强大的便签和笔记应用,也可以用来编写文档。它支持创建文本笔记、图片、音频等多种类型的笔记,并提供了强大的搜索和组织功能。

Evernote 提供了一个简洁而功能丰富的编辑器,让我们可以方便地编写和组织文档。它还支持在笔记中插入图片、录音和附件等,方便我们整理和记录相关的信息。

3. Google 文档

Google 文档 是一款在线协作文档编辑工具,可以方便地与其他人共同编辑和分享文档。它提供了类似于桌面办公软件的功能,包括文字编辑、格式调整、表格处理等。

Google 文档的在线协作功能非常强大,多人可以同时编辑同一份文档,并实时查看对方的修改。这对于团队协作和远程工作来说非常便利,提高了工作效率。

4. Microsoft Office

Microsoft Office 在桌面端是最为常用的办公软件之一,而它的移动端版本同样出色。它提供了 Word、Excel、PowerPoint 等多个组件,支持创建和编辑各种类型的文档。

Microsoft Office 的移动端应用界面简洁、功能强大。无论是在手机还是平板电脑上,它都能够提供与桌面版相似的操作体验。同时,Microsoft Office 还支持与其他设备进行同步,方便我们在不同设备间切换。

5. Ulysses

Ulysses 是一款专为写作而设计的应用。它提供了强大的编辑功能,支持 Markdown 格式和丰富的导出选项。

Ulysses 的界面简洁,操作直观。它将文档以库的形式进行组织,方便我们对文章进行管理和整理。同时,Ulysses 还支持多设备同步,我们可以在手机和电脑间无缝切换,提高工作效率。

总结

在选择手机编写文档的软件时,我们需要考虑多方面的因素。首先,要选择功能强大且易于使用的软件,以提升我们的工作效率。其次,要考虑软件的兼容性和稳定性,确保我们的文档能够在不同设备上进行无缝切换和编辑。最后,要考虑软件的价格和付费方式,选择适合自己的版本。

从以上几款手机编写文档的软件来看,它们各有特色,适用于不同的需求。无论是 WPS Office 的全面功能,还是 Evernote 的便捷笔记,或者是 Google 文档的协作能力,都能提供优秀的文档编辑体验。

无论你是在公交车上、咖啡厅里,还是在家中、办公室里,都可以利用这些手机编写文档的软件,提高工作效率,随时随地记录和编辑你的思考和灵感。

六、苹果手机怎么编写文档

苹果手机怎么编写文档

在今天的数字时代,苹果手机已经成为了我们日常生活中必不可缺的一部分。除了作为通讯工具和娱乐平台外,苹果手机还可以用来进行各种办公工作。其中,编写文档是一项非常重要的任务,无论是写作业、准备演讲稿,还是撰写工作报告,都需要一个好的文档编写工具。

苹果手机自带的文档编辑应用“Pages”是一个非常强大且易于使用的工具,它可以帮助您快速、简便地编写各种类型的文档。下面是几个简单的步骤,教您如何在苹果手机上使用Pages应用来编写文档。

第一步:打开Pages应用

首先,您需要在苹果手机上找到Pages应用并打开它。在主屏幕上滑动或使用搜索功能,找到Pages图标并点击。一般情况下,它是一个蓝色的应用图标,上面有一个白色的文件夹。

第二步:选择文档模板

一旦您打开了Pages应用,您将看到许多可供选择的文档模板。这些模板涵盖了各种不同类型的文档,包括简历、信函、报告等。选择与您当前需求最相关的模板,并点击它。您也可以选择一个空白模板,从头开始编写您的文档。

第三步:编辑文档内容

当您选择了一个模板后,您可以开始编辑文档的内容了。Pages应用提供了丰富的文本编辑功能,您可以通过点击页面上的文本框来输入文字。您还可以调整字体、颜色、对齐方式等文本样式的设置,以使您的文档更加美观。

此外,您还可以插入图片、表格、图表等元素来丰富您的文档内容。只需点击屏幕上方的“+”图标,选择要插入的元素类型,然后将其拖动到文档的适当位置。

第四步:保存和分享文档

完成文档的编辑后,您可以点击页面左上角的“完成”按钮来保存您的文档。如果您希望与他人分享您的文档,可以点击页面右上角的“分享”按钮,然后选择通过邮件、消息、云存储等方式分享。

此外,Pages应用还支持将文档导出为PDF、Word、ePub等格式,以便您在其他设备上进行查看和编辑。

结论

苹果手机的文档编辑应用Pages极大地方便了用户在手机上进行文档编写的需求。通过简单的几个步骤,您可以快速创建和编辑各种类型的文档,并与他人分享。不仅如此,Pages还提供了丰富的文本编辑和元素插入功能,使您的文档内容更加丰富多样。

因此,无论是学生还是职场人士,苹果手机都是一个非常优秀的工具,可用于高效地编写各种文档。希望本文可以帮助您更好地利用苹果手机来完成您的文档编写任务。

七、手机怎么编写plc?

安卓手机是不可以用plc编程软件的,但是我们可以实现手机APP控制PLC,其具体步骤如下:

工具/原料:鲲航科技的物联网DTU,西门子PLC一台

1、首先我们需要打开Step7 V4.0西门子编程软件,添加Modbus指令库,Port0口做modbus从站,程序初始化。

2、然后我们向VW0,VW2,VW4中传送数值1,2,3。

3、接着我们在鲲航云平台中组态,登录云平台;

4、接着我们选择新增设备,

5、然后我们需要配置输入表;

6、最后我们添加变量(对应PLC VW0,VW2,VW4),就可以实现手机APP控制PLC了。

八、手机如何编写word?

打开WPS点击“+”号

在手机上打开WPS Office,并点击右下角的“+”号。

点击“文字”选项

在弹出的菜单中点击第一个“文字”选项。

点击“新建空白”选项

接着再点击“新建空白”选项新建一个空白文档。

进入编辑Word文档

进入编辑界面,就可以开始编辑Word文档了。

九、怎样用手机编写代码。或者进入别人的系统?

下载[ALDE]可以编写代码,这个软件很强大可以直接开发app

十、编写系统测试计划的依据?

系统测试的要求,国家相关法律法规,以往系统测试参考,相关标准要求等

顶一下
(0)
0%
踩一下
(0)
0%
相关评论
我要评论
点击我更换图片