C语言课程设计报告学生宿舍管理系统文档格式.docx

上传人:b****2 文档编号:14657253 上传时间:2022-10-23 格式:DOCX 页数:15 大小:66.93KB
下载 相关 举报
C语言课程设计报告学生宿舍管理系统文档格式.docx_第1页
第1页 / 共15页
C语言课程设计报告学生宿舍管理系统文档格式.docx_第2页
第2页 / 共15页
C语言课程设计报告学生宿舍管理系统文档格式.docx_第3页
第3页 / 共15页
C语言课程设计报告学生宿舍管理系统文档格式.docx_第4页
第4页 / 共15页
C语言课程设计报告学生宿舍管理系统文档格式.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

C语言课程设计报告学生宿舍管理系统文档格式.docx

《C语言课程设计报告学生宿舍管理系统文档格式.docx》由会员分享,可在线阅读,更多相关《C语言课程设计报告学生宿舍管理系统文档格式.docx(15页珍藏版)》请在冰豆网上搜索。

C语言课程设计报告学生宿舍管理系统文档格式.docx

◎确定界面,使用户可选择操作项目(录入,删除,浏览,修改,查询,排序)。

◎录入:

使用结构体,要求用户输入楼栋、房号、面积、可住人数、已住人数

◎删除:

按房号删除以上信息

◎查询:

按房号查询以上信息

◎修改:

按房号修改以上信息

◎排序:

按已住人数排序信息

2.函数原型声明

structroom*add(structroom*head);

//添加函数

structroom*del(structroom*h);

//删除函数

voidshow(structroom*h);

//信息浏览函数

voidserh(structroom*h);

//查询与修改函数

structroom*sort(structroom*head);

//排序函数

voidcan();

//结束函数

二、用户使用说明

运行程序后即可按提示模仿以上操作进行。

1、菜单界面

2、入住登记界面

3、删除界面

4、浏览界面

5、查询修改

6、排序界面

7、退出

三、小结

通过编写该程序,熟悉了C语言的基本语法,选择,循环等结构,深入练习了函数的调用方法,和文件的读写方法,熟悉了结构体的使用,更加深化了面向过程语言思想,和一些基本算法。

通过对程序的后期调试,熟悉了C常见错误,锻炼了思维的严密性,和完备性。

通过对程序的注释和画流程图,形成了一套自己编程的风格,和清晰地思路,使思维更加条理化,清晰化。

四、参考文献

[1]谭浩强.C程序设计(第二版).北京:

清华大学出版社,1999

[2]邓文新.张宏烈.哈尔滨工业大学出版社

[3]XX.

五、附件源程序代码

#include<

stdio.h>

malloc.h>

string.h>

#include<

stdlib.h>

structroom

{

intLnum;

intFnum;

intsqua;

intmaxnum;

intinnum;

structroom*next;

};

//排序函数//修改点

voidmain()

structroom*head;

intx,y;

head=(structroom*)malloc(sizeof(structroom));

head->

next=NULL;

printf("

欢迎使用学生宿舍管理系统!

\n"

);

按回车键进入菜单界面\n"

getchar();

while

(1)

{

A:

printf("

[]--------------------------------------------[]\n"

||--------------------------------------------||\n"

||1.入住登记||\n"

||2.删除信息||\n"

||3.信息浏览||\n"

||4.查询修改||\n"

printf("

||5.按入住人数排序||\n"

||6.退出系统||\n"

请选择服务项目!

flushall();

scanf("

%d"

&

x);

//菜单选择

if(head->

next==NULL&

&

x!

=1&

=6)

{

printf("

系统中无入住信息,请先进行入房登记!

gotoA;

}

switch(x)

case1:

head=add(head);

system("

cls"

登记完毕!

continue;

case2:

head=del(head);

T:

scanf("

y);

while(y!

y!

=0)

{

printf("

输入错误!

请重新输入!

gotoT;

}

if(y==1)

{system("

continue;

}

else

can();

gotoN;

case3:

show(head);

是否返回菜单界面进行其他操作?

(1/0)\n"

J:

scanf("

gotoJ;

gotoN;

case4:

serh(head);

case5:

head=sort(head);

//修改点

while(y!

continue;

case6:

can();

gotoQ;

default:

N:

if(y==0)

break;

Q:

if(x==6)

}

structroom*add(structroom*head)//入住登记

structroom*h,*p;

inti=0,n;

h=head;

请输入要登记的入房数:

n);

请输入入住信息:

\n楼号房号面积最大入住人数已入住人数\n"

数据须按规定顺序输入,不同数据用空格分开。

for(i=0;

i<

n;

i++)

p=(structroom*)malloc(sizeof(structroom));

%d%d%d%d%d"

p->

Lnum,&

Fnum,&

squa,&

maxnum,&

innum);

p->

next=h->

next;

h->

next=p;

returnh;

structroom*del(structroom*h)//退房登记

intx;

structroom*p,*q;

p=h->

q=h;

请输入退房房号:

if(p==NULL)

不存在此入房登记!

\n是否返回菜单界面进行其他操作?

(1/0)"

else

while(p)

if(p->

Fnum==x)

q->

next=p->

free(p);

删除成功!

gotoK;

q=p;

p=p->

if(p==NULL)

K:

voidshow(structroom*h)

structroom*p;

if(p==NULL)

无信息可显示!

\n楼号房号面积所容纳人数已入住人数\n\n"

%-7d%-7d%-8d%-13d%-8d\n"

p->

Lnum,p->

Fnum,p->

squa,p->

maxnum,p->

p=p->

voidserh(structroom*h)//入住信息查询与修改

intx,y,z;

H:

printf(

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高中教育 > 语文

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1