《家庭财务管理系统.doc》由会员分享,可免费在线阅读全文,更多与《(定稿)家庭财务管理系统(完整版)》相关文档资源请在帮帮文库(www.woc88.com)数亿文档库存里搜索。
1、ntyear;年份
intmonth;月份
intincome;收入
intoutut;支出
}thi[maxinfor];
intn=,m=;全局变量n为文件中家庭成员实际容量m为文件中收支信息实际容量
inthold()将数据写进文件中
{
FILE*f;
in。
2、ucteole家庭成员登录信息结构
{
charusername[];用户名(也是姓名)
charcode[];密码
charflag[];标志为普通成员,为家长
}eo[maxsize];
structthing成员收支信息结构
{
charname[];姓名
i。
3、
inti,=,h=,a,b;
charname[],name[];
carry();
rintf(quot\n【更换家长】\n\n请输入现任家长的姓名:quot);
scanf(quot%squot,name);
for(i=;iltn;i++)
{
if(strcm(e。
4、o[i]username,name)==amamstrcm(eo[i]flag,quotquot)==)
{
a=i;
=;
eak;
}
}
if(==)rintf(quo{
intk=,i,=;
charname[];
carry();
rintf(quot\n。
5、f(quot\n\n录入成功。\nquot);
hold();==m)k=;
if(k==)rintf(quot\n不存在该成员的收支信息。\nquot);
if(k==)
{
rintf(quot\n%s的所有收支信息:\n\nquot,name);
C语言课程设计家庭财务。
6、=)
{
rintf(quot\n请输入收入(元):quot);
scanf(quot%dquot,amthi[m]income);
rintf(quot\n请输入支出(元):quot);
scanf(quot%dquot,amthi[m]outut);
m++;
rint。
7、]year==thi[m]yearamamthi[i]month==
thi[m]month)
{
rintf(quot\n已存在%d年%d月的收支信息。\n录入失败。。。
\nquot,thi[m]year,thi[m]month);
=;
eak;
}
}
if(=。
8、eak;}
}
if(i==n)k=;
if(k==)rintf(quot\n不存在该成员,请先添加其为家庭成员。\nquot);
if(k==)
{
strcy(thi[m]name,name);
rintf(quot\n请输入年份:quot);
scanf(quot%。
9、管理系统txt
includeltstdiohgt
includeltstringhgt
includeltstdlibhgt
includeltconiohgt
definemaxsize定义家庭成员最大人数
definemaxinfor定义收支信息的最大容量
str。
10、ti;
f=foen(quoteolelisttxtquot,quotwquot);
{
frintf(f,quot%d\nquot,n);
for(i=;iltn;i++)
frintf(f,quot%s%s%s\nquot,eo[i]username,eo[i]code,e。
11、dquot,amthi[m]year);
rintf(quot\n请输入月份:quot);
scanf(quot%dquot,amthi[m]month);
for(i=;iltm;i++)
{
if(strcm(eo[i]username,name)==amamthi[i 。
12、【录入收支信息】\n\n请按以下顺序录入成员收支信息:\nquot);
rintf(quot\n请输入姓名:quot);
scanf(quot%squot,name);
for(i=;iltn;i++)
{
if(strcm(eo[i]username,name)==){k=;