当前位置:网站首页>C语言课设物业费管理系统(大作业)
C语言课设物业费管理系统(大作业)
2022-07-01 06:17:00 【普通学长】

一、设计功能(文章仅供参考)
功能要求:
(1)新住户信息的添加。(户主姓名、性别、身份证号、联系电话、楼号、单元号、房号、平米数、每平米物业价格、应缴纳物业费,备注信息)
(2)修改住户信息的功能。
(3)删除住户信息的功能。
(4)应缴物业费自动生成。每月1号,自动生成本月份的物业费。如果该住户之前的物业费未交清,则本月物业费与之前拖欠费用进行累加,为该用户应缴纳的物业费。
(5)缴费功能。根据用户缴纳金额,修改“应缴纳物业费”。
(6)统计功能:能够按楼号分类统计所有未交清物业费的记录。能够按拖欠款项多少,对所有用户信息进行从大到小排序。
(7)用菜单进行管理
二、功能展示

三、思维导图


四、程序源码
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<malloc.h>
#include<conio.h> //函数声明//
int mainmenu(); //主菜单
void xinximenu(); //物业信息菜单
void tongjimenu();//统计查询菜单
void mychaozhao(); //欠费名单
void yezhumenu();//业主菜单
void wuyemenu();//物业菜单
void myAdd1();//录入业主信息
void myAdd2(); //录入物业信息
void myDelete1();//删除业主信息
void myDelete2();//删除物业信息
void myReplace1();//修改业主信息
void myReplace2();//修改物业信息
void Display1();//浏览业主信息
void Display2();//浏览物业信息
void myfind();//查询缴费
void Display(struct wuye *p);
void Read1();
void Read2();
void save1(struct yezhu *p);//保存业主信息至文件
void save2(struct wuye *p);//保存物业信息至文件
struct yezhu *find1(char *id); //查找业主信息
struct wuye *find2(char *id);//查找物业信息`
struct yezhu *myAdd3(struct yezhu *p);//添加业主信息
struct wuye *myAdd4(struct wuye *p);
struct yezhu {
//业主结构体//
char id[100];
char name[20];
char sex[5];
int phone_num;
int floor_num;
char room_num[100];
float lost;
int area;
char rz_time[20];
char bz[100];
struct yezhu *next;
};
struct wuye {
//物业信息结构体//
char ID[100];
int last_year;
int last_month;
float money;
int to_time;
struct wuye *link;
};
struct yezhu *phead; //业主头结点
struct wuye *pHead; //物业头结点
int mainmenu()//主菜单//
{
int n;
printf("**************************欢迎进入小区物业管理系统***************************\n");
printf("-----------------------------------------------------------------------------\n");
printf("* * * * * * * * * * * * * * * 〓请选择〓13* * * * * * * * * * * * * * *\n");
printf("* *\n"); printf("* *\n");
printf("* ⒈物业信息系统 *\n");
printf("* *\n");
printf("* ⒉统计查询系统 *\n");
printf("* *\n");
printf("* ⒊退出程序。 *\n");
printf("* *\n");
printf("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf("请您输入选项*№:");
scanf("%d",&n);
return n;
}
void xinximenu()//物业信息菜单显示//
{
int choose;
do {
("*****************************物 业 信 息 系 统************************************\n");
printf("-----------------------------------------------------------------------------\n");
printf("* * * * * * * * * * * * * * * 〓请选择〓13* * * * * * * * * * * * * * *\n");
printf("* *\n");
printf("* *\n");
printf("* ⒈小区业主信息管理 *\n");
printf("* *\n");
printf("* ⒉物业费用信息管理 *\n");
printf("* *\n");
printf("* ⒊返回主菜单。 *\n");
printf("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf("请您输入选项*№:");
scanf("%d",&choose);
switch(choose)
{
case 1:yezhumenu();
break;
case 2:wuyemenu();
break;
case 3:return;
default:printf("输入错误请重新输入\n");
}
} while(1); }
void tongjimenu() //统计查询菜单显示//
{
int choose;
{
printf("******************************统 计 查 询 系 统***********************************\n");
printf("-----------------------------------------------------------------------------\n");
printf("* * * * * * * * * * * * * * * 〓请选择〓13* * * * * * * * * * * * * * *\n");
printf("* *\n");
printf("* *\n");
printf("* ⒈查询缴费信息 *\n");
printf("* *\n");
printf("* ⒉欠费名单一览表 *\n");
printf("* *\n");
printf("* ⒊返回主菜单。 *\n");
printf("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf("请您输入选项*№:");
scanf("%d",&choose);
switch(choose)
{
case 1 : myfind();
break;
case 2 : mychaozhao();
break;
case 3 : return;
default: printf("输入错误请重新输入!\n\n");
}
}
}
void yezhumenu() //业主菜单函数
{
int choose;
do {
printf("********************************业主信息编辑系统******************************-\n");
printf("-------------------------------------------------------------------------------\n");
printf("* * * * * * * * * * * * * * * *〓请选择〓15* * * * * * * * * * * * * * *\n");
printf("* *\n");
printf("* *\n");
printf("* ⒈业主信息录入 *\n");
printf("* *\n");
printf("* ⒉业主信息修改 *\n");
printf("* *\n");
printf("* ⒊业主信息删除 *\n");
printf("* *\n");
printf("* ⒋业主信息浏览 *\n");
printf("* *\n");
printf("* ⒌返回上级菜单。 *\n");
printf("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf("请输入选项*№");
scanf("%d",&choose);
//getchar();
switch(choose)
{
case 1 :myAdd1();
break;
case 2 :myReplace1();
break;
case 3 :myDelete1();
break;
case 4 :Display1();
break;
case 5 : return;
default: printf("输入错误请重新输入\n");
}
} while(1);
}
void myAdd1()//录入业主信息//
{
struct yezhu *p;
p=(struct yezhu *)malloc(sizeof(struct yezhu));
printf("请录入业主信息\n");
printf("ID:");
scanf("%s",p->id);
printf("姓名:");
scanf("%s",p->name);
printf("性别");
scanf("%s",&p->sex);
printf("联系电话");
scanf("%d",&p->phone_num);
printf("所在楼号");
scanf("%d",&p->floor_num);
printf("单元房间号:");
scanf("%s",p->room_num);
printf("每平米物业价格:");
scanf("%d",&p->area);
printf("应缴物业费");
scanf("%s",p->rz_time);
printf("备注");
scanf("%s",p->bz);
myAdd3(p);
savel(p);
printf("录入成功!\n");
}
struct yezhu *myAdd3(struct yezhu *p)//添加业主信息结点//
{
struct yezhu *t;
if(phead==NULL)
{
phead=p;
p->next=NULL;
}
else
{
t=phead;
while(t->next!=NULL)
t=t->next;
t->next=p;
p->next=NULL;
return phead;
}
}
void myReplace1()//修改业主信息
{
struct yezhu *k;
char id[100];
printf("请输入要修改的业主ID:");
scanf("%s",id);
k=find1(id);
if(k!=NULL)
{
printf("请输入要修改的业主信息\n");
printf("ID:");
scanf("%s",k->id);
printf("姓名:");
scanf("%s",k->name);
printf("性别");
scanf("%d",&k->sex);
printf("联系电话");
scanf("%d",&k->phone_num);
scanf("%d",&k->phone_num);
printf("所在楼号");
scanf("%d",&k->floor_num);
printf("单元房间号:");
scanf("%s",k->room_num);
printf("每平米物业价格:");
scanf("%d",&k->area);
printf("应缴物业费");
scanf("%s",k->rz_time);
printf("备注 ");
scanf("%s",k->bz);
savel(k);
printf("修改成功!\n");
}
else
{
printf("无此业主ID!\n");
return;
}
}
struct yezhu *find1(char *id)//通过ID查找业主信息//
{
struct yezhu *p;
p=phead;
while(p!=NULL)
{
if(strcmp(p->id,id)==0)
return p;
p=p->next;
}
return NULL;
}
void Display1()
{
struct yezhu *p;
p=phead;
p=phead;
while(p!=NULL)
{
printf("\n\n");
printf("ID:%s\n",p->id);
printf("姓名:%s\n",p->name);
printf("性别:%d\n",p->sex);
printf("联系电话%d\n",p->phone_num);
printf("所在楼号%d\n",p->floor_num);
printf("单元房间号:%s\n",p->room_num);
printf("每平米物业价格:%d\n",p->area);
printf("应缴物业费%s\n",p->rz_time);
printf("备注 %s\n",p->bz);
printf("\n\n");
p=p->next;
}
}
void myDelete1()
{
struct yezhu *p,*pp;
struct wuye *k,*kk;
char id[100];
pp=phead;
kk=pHead;
printf("请输入要删除人的ID:");
scanf("%s",id);
p=find1(id);
k=find2(id);
if(p!=NULL)
{
if(p==phead)
{
phead=p->next;
free(p);
}
else
{
while(pp->next!=p)
pp=pp->next;
pp->next=p->next;
free(p);
}
}
else
{
printf("无此业主ID!\n");
return;
}
printf("删除业主信息成功!\n");
savel(p);
if(k!=NULL)
{
if(k==pHead)
{
pHead=k->link;
free(k);
}
else
{
while(kk->link!=k)
kk=kk->link;
kk->link=k->link;
free(k);
}
}
else
{
printf("无此业主ID!\n");
return;
}
printf("删除物业信息成功!\n");
savew(k);
}
void savel(struct yezhu *p)
{
FILE *fp; //打开文件//
fp=fopen("yezhu.dat","wb");
p=phead;
while(p!=NULL)
{
fwrite(p,sizeof(struct yezhu),1,fp); //向文件写入一个数据块//
p=p->next;
}
fclose(fp);
}
void Read1() //文件操作读取数据//
{
FILE *fp;
struct yezhu *p;
fp=fopen("yezhu.dat","rb");
while(1)
{
p=(struct yezhu *)malloc(sizeof(struct yezhu)); //先计算所字节后向系统申请分配字节内存空间//
if(feof(fp)) //文件结束符//
{
break;
}
if(fread(p,sizeof(struct yezhu),1,fp)) //读取数据//
{
myAdd3(p);
}
}
fclose(fp);
}
void wuyemenu()
{
int choose=0;
do {
printf("*********************************物业费用管理系统************************\n");
printf("-------------------------------------------------------------------------\n");
printf("* * * * * * * * * * * * * * * 〓请选择〓15* * * * * * * * * * * * *\n");
printf("* * \n");
printf("* *\n");
printf("* ⒈物业信息录入 *\n");
printf("* *\n");
printf("* ⒉物业信息修改 *\n");
printf("* *\n");
printf("* ⒊物业信息删除 *\n");
printf("* *\n");
printf("* ⒋物业信息浏览 *\n");
printf("* *\n");
printf("* ⒌返回上级菜单。 *\n");
printf("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n");
printf("请输入选项");
scanf("%d",&choose);
switch(choose)
{
case 1: myAdd2();
break;
case 2: myReplace2();
break;
case 3: myDelete2();
break;
case 4: Display2();
break;
case 5: return;
default:printf("输入错误请重新输入\n");
}
} while(1);
}
void myAdd2()//录入物业信息//
{
struct wuye *p;
struct yezhu *t;
int x;
p=(struct wuye *)malloc(sizeof(struct wuye));
printf("请录入物业信息\n");
printf("ID:");
scanf("%s",p->ID);
t=find1(p->ID);
if(t!=NULL)
{
printf("上一次缴费年份");
scanf("%d",&p->last_year);
printf("月份");
scanf("%d",&p->last_month);
printf("缴费金额");
scanf("%f",&p->money);
x=p->money/(0.4*t->area);
p->to_time=(int)x;
myAdd4(p);
savew(p);
printf("录入成功!\n");
}
else
{
printf("无此业主ID!\n");
return;
}
}
struct wuye *myAdd4(struct wuye *p)//添加物业信息结点//
{
struct wuye *t;
if(pHead==NULL)
{
pHead=p;
p->link=NULL;
}
else
{
t=pHead;
while(t->link!=NULL)
t=t->link;
t->link=p;
p->link=NULL;
}
return pHead;
}
struct wuye *find2(char *id)//通过姓名查找缴费信息//
{
struct wuye *p;
p=pHead;
while(p!=NULL)
{
if(strcmp(p->ID,id)==0)
return p;
p=p->link;
}
return NULL;
}
void myfind()
{
struct wuye *p;
char a[100];
printf("请输入要查找的业主id");
scanf("%s",a);
p=find2(a);
if(p!=NULL)
{
printf("业主已经存缴!\n");
}
else
{
printf("业主尚没存缴信息!\n");
return;
}
myDisplay(p);
}
void myReplace2()//
{
char id[20];
int x;
struct wuye *k;
struct yezhu *t;
printf("请输入要修改的业主ID:");
scanf("%s",id);
if(k!=NULL)
{
printf("您要修改的信息为\n");
printf("请输入新的信息\n");
printf("ID:");
scanf("%s",k->ID);
printf("上一次缴费年份");
scanf("%d",&k->last_year);
printf("月份");
scanf("%d",&k->last_month);
printf("缴费金额");
scanf("%f",&k->money);
t=find1(k->ID);
x=(int)k->money/(0.4*t->area);
k->to_time=(int)x;
myAdd4(k);
savew(k);
printf("修改成功!\n");
}
else
{
printf("无此业主ID!\n");
return;
}
}
void myDelete2()//
{
struct wuye *p,*pp;
char id[100];
pp=pHead;
printf("请输入要删除人的ID:");
scanf("%s",id);
p=find2(id);
if(p!=NULL)
{
if(p==pHead)
{
pHead=p->link;
free(p);
}
else
{
while(pp->link!=p)
pp=pp->link;
pp->link=p->link;
free(p);
}
}
else
{
printf("无此业主ID!\n");
return;
}
savew(p);
printf("删除成功!\n");
}
void Display2()
{
struct wuye *p;
p=pHead;
while(p!=NULL)
{
printf("ID:%s\n",p->ID);
printf("最 后 一 次 缴 费 日 期 %d年%d月\n",p->last_year,p->last_month);
printf("缴费金额:%f元\n",p->money);
printf("费用有效期%d个月\n",p->to_time);
printf("\n\n\n");
p=p->link;
}
}
void myDisplay(struct wuye *p)
{
printf("业主ID:%s\n",p->ID);
printf("最 后 一 次 缴 费 日 期 %d年%d月\n",p->last_year,p->last_month);
printf("最后一次缴费金额%f\n",p->money);
printf("费用有效期%d个月\n",p->to_time);
}
void Read2()//
{
FILE *fp;
struct wuye *p;
fp=fopen("wuye.dat","rb");
while(1)
{
p=(struct wuye *)malloc(sizeof(struct wuye));
if(feof(fp))
break;
if(fread(p,sizeof(struct wuye),1,fp))
myAdd4(p);
}
fclose(fp);
}
void savew(struct wuye *p)//
{
FILE *fp; fp=fopen("wuye.dat","wb");
p=pHead;
while(p!=NULL)
{
fwrite(p,sizeof(struct wuye),1,fp);
p=p->link;
}
fclose(fp);
}
void mychaozhao()//
{
int year,month;
struct wuye *k;
struct yezhu *l;
k=pHead;
l=phead;
printf("请输入当前年份");
scanf("%d",&year);
printf("请输入当前月份");
scanf("%d",&month);
while(k!=NULL)
{
if(year>k->last_year)
{
l=find1(k->ID);
l->lost=(float)(month+12-k->to_time-k->last_month)*(0.4*l->area);
if(l->lost>0)
{
printf("业主ID*:%s\n",l->id);
printf("业主姓名*%s\n",l->name);
printf("最后一次缴费日期%d年%d月\n",k->last_year,k->last_month);
printf("欠费金额*%f\n",l->lost);
printf("\n\n");
}
}
if(year==k->last_year)
{
l=find1(k->ID);
l->lost=(float)(month-k->to_time-k->last_month)*(0.4*l->area);
if(l->lost>0)
{
printf("业主ID:%s\n",l->id);
printf("业主姓名%s\n",l->name);
printf("最后一次缴费日期%d年%d月\n",k->last_year,k->last_month);
printf("欠 费 金 额 %f\n",l->lost);
printf("\n\n");
}
}
k=k->link;
}
}
int main()//
{
int m;
//Read1();//第一次没有信息不可用
//Read2();//第一次没有信息不可用
do {
m=mainmenu();
switch(m)
{
case 1: xinximenu();
break;
case 2: tongjimenu();
break;
case 3:printf("*****************************谢谢使用,再见!***********************************\n"); exit(0);
}
} while(1);
return 1;
}

大家可以点个关注后续会持续更新0.0(在此先谢过各位了)
边栏推荐
- highmap gejson数据格式转换脚本
- 虚幻 简单的屏幕雨滴后处理效果
- Minio error correction code, construction and startup of distributed Minio cluster
- 蚂蚁新村田头村变甜头村 让厦门灌口镇田头村变甜头村的特色农产品之一是
- Tidb single machine simulation deployment production environment cluster (closed pit practice, personal test is effective)
- C# ManualResetEvent 类的理解
- Freeswitch dial the extension number
- 【ManageEngine卓豪】用统一终端管理助“欧力士集团”数字化转型
- 1034 Head of a Gang
- To sort out the anomaly detection methods, just read this article!
猜你喜欢

JMM详解
![[postgraduate entrance examination advanced mathematics Wu Zhongxiang +880 version for personal use] advanced mathematics Chapter II Basic Stage mind map](/img/c0/299a406efea51f24b1701b66adc1e3.png)
[postgraduate entrance examination advanced mathematics Wu Zhongxiang +880 version for personal use] advanced mathematics Chapter II Basic Stage mind map

指数法和Random Forest实现山东省丰水期地表水体信息

69 cesium code datasource loading geojson

虚幻 简单的屏幕雨滴后处理效果

High order binary search tree

HCM Beginner (II) - information type
![Pit of kotlin bit operation (bytes[i] and 0xff error)](/img/2c/de0608c29d8af558f6f8dab4eb7fd8.png)
Pit of kotlin bit operation (bytes[i] and 0xff error)

【ManageEngine卓豪 】助力世界顶尖音乐学院--茱莉亚学院,提升终端安全

C语言课设工资管理系统(大作业)
随机推荐
扩散(多源广搜)
UOW of dev XPO comparison
局域网监控软件有哪些功能
High order binary search tree
Stack Title: parsing Boolean expressions
自开发软件NoiseCreater1.1版本免费试用
Recueillir des trésors dans le palais souterrain (recherche de mémoire profonde)
json模块
Minio error correction code, construction and startup of distributed Minio cluster
记磁盘扇区损坏导致的Mysql故障排查
【ManageEngine】终端管理系统,助力华盛证券数字化转型
证券类开户有什么影响 开户安全吗
IT服务管理(ITSM)在高等教育领域的应用
Using Baidu map to query national subway lines
ABP 学习解决方案中的项目以及依赖关系
分布式锁实现
端口扫描工具对企业有什么帮助?
C语言课设职工信息管理系统(大作业)
【KV260】利用XADC生成芯片温度曲线图
【ManageEngine卓豪】用统一终端管理助“欧力士集团”数字化转型