本篇财务软件的文章要给大家谈谈c语言财务软件怎么编写,以及财务编程语言对应的财务软件相关知识点,希望对财务软件爱好者学习有所帮助。
本文目录一览:
- 1、求助C语言编译个人财务管理系统!(尽快啊)
- 2、我想自学财务管理软件的编程,请问各位大神需要具备什么样的条件
- 3、C语言编写一个软件?
求助C语言编译个人财务管理系统!(尽快啊)
/******头文件(.h)***********/
#include "stdio.h" /*I/O函数*/
#include "stdlib.h" /*标准库函数*/
#include "string.h"/*字符串函数*/
#include "ctype.h" /*字符操作函数*/
#define M 200 /*定义常数表示记录数*/
typedef struct /*定义数据结构*/
{
char name[20]; /*姓名*/
char units[30]; /*单位*/
char tele[10]; /*电话*/
char product_company[30];/* 生产厂家 */
char designer[30]; /* 设计者 */
char price[10]; /* 价格 */
char kucun[10]; /* 库存量 */
char year[4]; /* 出厂年份 */
char month[2]; /* 出厂月份 */
char day[2]; /* 出厂 */
}ADDRESS;
/******以下是函数原型*******/
int enter(ADDRESS t[]); /*输入记录*/
void list(ADDRESS t[],int n); /*显示记录*/
void search(ADDRESS t[],int n); /*按姓名查找显示记录*/
int delete(ADDRESS t[],int n); /*删除记录*/
int add(ADDRESS t[],int n); /*插入记录*/
void save(ADDRESS t[],int n); /*记录保存为文件*/
int load(ADDRESS t[]); /*从文件中读记录*/
void display(ADDRESS t[]); /*按序号查找显示记录*/
void sort(ADDRESS t[],int n); /*按姓名排序*/
void modify_price(ADDRESS t[],int n); /*快速查找记录*/
void copy(); /*文件复制*/
void print(ADDRESS temp); /*显示单条记录*/
int find(ADDRESS t[],int n,char *s) ; /*查找函数*/
int menu_select(); /*主菜单函数*/
/******主函数开始*******/
main()
{
int i;
ADDRESS adr[M]; /*定义结构体数组*/
int length=0; /*保存记录长度*/
clrscr(); /*清屏*/
for(;;)/*无限循环*/
{
clrscr(); /*清屏*/
switch(menu_select()) /*调用主菜单函数,返回值整数作开关语句的条件*/
{
case 0:length=enter(adr);break;/*输入记录*/
case 1:list(adr,length);break; /*显示全部记录*/
case 2:search(adr,length);break; /*查找记录*/
case 3:length=delete(adr,length);break; /*删除记录*/
case 4:length=add(adr,length); break; /*插入记录*/
case 5:save(adr,length);break; /*保存文件*/
case 6:modify_kucun(adr,length); break; /*读文件*/
case 7:display(adr);break; /*按序号显示记录*/
case 8:sort(adr,length);break; /*按姓名排序*/
case 9:modify_kucun(adr,length);break; /*快速查找记录*/
case 10:copy();break; /*复制文件*/
case 11:exit(0); /*如返回值为11则程序结束*/
}
}
}
/*菜单函数,函数返回值为整数,代表所选的菜单项*/
menu_select()
{
char s[80];
int c;
/*gotoxy(1,25);*//* 将光标定为在第25行,第1列*/
printf("press any key enter menu......\n");/*提示压任意键继续*/
getch(); /*读入任意字符*/
clrscr(); /*清屏*/
/*gotoxy(1,1); */
printf("********************MENU*********************\n\n");
printf(" 0. Enter record\n");
printf(" 1. List the file\n");
printf(" 2. Search record on name\n");
printf(" 3. Delete a record\n");
printf(" 4. add record \n");
printf(" 5. Save the file\n");
printf(" 6. Modify kucun\n");
printf(" 7. Display record on order\n");
printf(" 8. Sort to make new file\n");
printf(" 9. Quick seek record\n");
printf(" 10. Copy the file to new file\n");
printf(" 11. Quit\n");
printf("***********************************************\n");
do{
printf("\n Enter you choice(0~11):"); /*提示输入选项*/
scanf("%s",s); /*输入选择项*/
c=atoi(s); /*将输入的字符串转化为整型数*/
}while(c0||c11); /*选择项不在0~11之间重输*/
clrscr(); /*清屏*/
return c; /*返回选择项,主程序根据该数调用相应的函数*/
}
/***输入记录,形参为结构体数组,函数值返回类型为整型表示记录长度*/
int enter(ADDRESS t[])
{
int i,n;
char *s;
clrscr(); /*清屏*/
do{
printf("\nHow many numbers do you want to record?\nplease input the numbers you wanted:\n"); /*提示信息*/
scanf("%d",n); /*输入记录数*/
if(n==0)
printf("the num couldn't be '0'!Please enter again!");
}while(n==0);
printf("please input record! \n"); /*提示输入记录*/
printf("name|unit|telephone|product_company|designer|price|kucun|year|month|day\n");
printf("------------------------------------------------\n");
for(i=0;in;i++)
{
/*scanf("%s %s %s %s %s %s %s %s %s %s",t[i].name,t[i].units,t[i].tele,t[i].product_company,t[i].designer,t[i].price,t[i].kucun,t[i].year,t[i].month,t[i].day); *//*输入记录*/
printf("name:"); /* 打印输出号码 */
scanf("%s",t[i].name);/* 用数组输入号码 */
printf("unit:"); /* 打印输出名字 */
scanf("%s",t[i].units); /* 用数组输入姓名 */
printf("telephone:");/* 打印输出性别 */
scanf("%s",t[i].tele);/* 用数组输入性别 */
printf("product_company:"); /* 打印输出生日 */
scanf("%s",t[i].product_company); /* 用数组输入生日 */
printf("designer:");/* 打印输出婚姻状况 */
scanf("%s",t[i].designer);/* 用数组输入婚姻状况 */
printf("price:");/* 打印输出工作状况 */
scanf("%s",t[i].price);/* 用数组输入工作状况 */
printf("kucun:");/* 打印输出工作状况 */
scanf("%s",t[i].kucun);/* 用数组输入工作状况 */
printf("produce year:");/* 打印输出工作状况 */
scanf("%s",t[i].year);/* 用数组输入工作状况 */
printf("produce month:");/* 打印输出工作状况 */
scanf("%s",t[i].month);/* 用数组输入工作状况 */
printf("produce day:");/* 打印输出工作状况 */
scanf("%s",t[i].day);/* 用数组输入工作状况 */
printf("-----------Ok!this record have been recorded!------------\n");
}
printf("the all have been recorded!\n");
getch();
clrscr();
return n; /*返回记录条数*/
}
/*显示记录,参数为记录数组和记录条数*/
void list(ADDRESS t[],int n)
{
int i;
clrscr();
printf("\n\n*******************ADDRESS******************\n");
printf("name|unit|telephone|product_company|designer|price|kucun|year|month|day\n");
printf("------------------------------------------------------------------------\n");
if(n!=0)
for(i=0;in;i++)
{
printf("%s/%s/%s/%s/%s/%s/%s/%s/%s/%s",t[i].name,t[i].units,t[i].tele,t[i].product_company,t[i].designer,t[i].price,t[i].kucun,t[i].year,t[i].month,t[i].day);
if((i+1)%10==0) /*判断输出是否达到10条记录*/
{
printf("Press any key continue...\n"); /*提示信息*/
getch(); /*压任意键继续*/
}
}
else printf("there is no record!\n");
printf("************************end*******************\n");
}
/*查找记录*/
void search(ADDRESS t[],int n)
{
char s[20]; /*保存待查找姓名字符串*/
int i; /*保存查找到结点的序号*/
/*clrscr(); */
printf("please input the search name:\n");
scanf("%s",s); /*输入待查找姓名*/
i=find(t,n,s); /*调用find函数,得到一个整数*/
if(in-1) /*如果整数i值大于n-1,说明没找到*/
printf("not found!\n");
else
print(t[i]); /*找到,调用显示函数显示记录*/
clrscr();
}
/*显示指定的一条记录*/
void print(ADDRESS temp)
{
/* clrscr(); */
printf("\n\n********************************************\n");
printf("name|unit|telephone|product_company|designer|price|kucun|year|month|day\n");
/*printf("------------------------------------------------\n"); */
printf("%s/%s/%s/%s/%s/%s/%s/%s/%s/%s",temp.name,temp.units,temp.tele,temp.product_company,temp.designer,temp.price,temp.kucun,temp.year,temp.month,temp.day);
printf("**********************end***********************\n");
}
/*查找函数,参数为记录数组和记录条数以及姓名s */
int find(ADDRESS t[],int n,char *s)
{
int i;
for(i=0;in;i++)/*从第一条记录开始,直到最后一条*/
{
if(strcmp(s,t[i].name)==0) /*记录中的姓名和待比较的姓名是否相等*/
return i; /*相等,则返回该记录的下标号,程序提前结结束*/
}
return i; /*返回i值*/
}
/*删除函数,参数为记录数组和记录条数*/
int delete(ADDRESS t[],int n)
{
char s[20]; /*要删除记录的姓名*/
int ch=0;
int i,j;
printf("please deleted name\n"); /*提示信息*/
scanf("%s",s);/*输入姓名*/
i=find(t,n,s); /*调用find函数*/
if(in-1) /*如果in-1超过了数组的长度*/
printf("no found not deleted\n"); /*显示没找到要删除的记录*/
else
{
print(t[i]); /*调用输出函数显示该条记录信息*/
printf("Are you sure delete it(1/0)\n"); /*确认是否要删除*/
scanf("%d",ch); /*输入一个整数0或1*/
if(ch==1) /*如果确认删除整数为1*/
{
for(j=i+1;jn;j++) /*删除该记录,实际后续记录前移*/
{
strcpy(t[j-1].name,t[j].name); /*将后一条记录的姓名拷贝到前一条*/
strcpy(t[j-1].units,t[j].units); /*将后一条记录的单位拷贝到前一条*/
strcpy(t[j-1].tele,t[j].tele); /*将后一条记录的电话拷贝到前一条*/
strcpy(t[j-1].product_company,t[j].product_company);
strcpy(t[j-1].designer,t[j].designer);
strcpy(t[j-1].price,t[j].price);
strcpy(t[j-1].kucun,t[j].kucun);
strcpy(t[j-1].year,t[j].year);
strcpy(t[j-1].month,t[j].month);
strcpy(t[j-1].day,t[j].day);
}
n--; /*记录数减1*/
}
}
return n; /*返回记录数*/
}
/*插入记录函数,参数为结构体数组和记录数*/
int add(ADDRESS t[],int n)/*插入函数,参数为结构体数组和记录数*/
{
ADDRESS temp; /*新插入记录信息*/
int i,j;
char s[20],p; /*确定插入在哪个记录之前*/
printf("please input the new record:\n");
printf("************************************************\n");
printf("name|unit|telephone|product_company|designer|price|kucun|year|month|day\n");
/*printf("--------------------------------------------------\n");
scanf("%s%s%s",temp.name,temp.units,temp.tele); *//* 输入插入信息*/
printf("name:"); /* 打印输出号码 */
scanf("%s",temp.name);/* 用数组输入号码 */
printf("unit:"); /* 打印输出名字 */
scanf("%s",temp.units); /* 用数组输入姓名 */
printf("telephone:");/* 打印输出性别 */
scanf("%s",temp.tele);/* 用数组输入性别 */
printf("product_company:"); /* 打印输出生日 */
scanf("%s",temp.product_company); /* 用数组输入生日 */
printf("designer:");/* 打印输出婚姻状况 */
scanf("%s",temp.designer);/* 用数组输入婚姻状况 */
printf("price:");/* 打印输出工作状况 */
scanf("%s",temp.price);/* 用数组输入工作状况 */
printf("kucun:");/* 打印输出工作状况 */
scanf("%s",temp.kucun);/* 用数组输入工作状况 */
printf("produce year:");/* 打印输出工作状况 */
scanf("%s",temp.year);/* 用数组输入工作状况 */
printf("produce month:");/* 打印输出工作状况 */
scanf("%s",temp.month);/* 用数组输入工作状况 */
printf("produce day:");/* 打印输出工作状况 */
scanf("%s",temp.day);/* 用数组输入工作状况 */
printf("-----------Ok!this record have been recorded!------------\n");
printf("------------------------------------------------\n");
K:printf("please input the wanted name's position to insert:\n");
scanf("%s",s); /*输入插入位置的姓名*/
i=find(t,n,s); /*调用find,确定插入位置*/
if(in-1) /*如果in-1超过了数组的长度*/
{
printf("the name isn't exist!\n"); /*显示没找到要删除的记录*/
printf("Are you want to continue to insert?Yes--y/No--any other key!\n");
if(getch()=='y') goto K;
}
else
{
for(j=n-1;j=i;j--) /*从最后一个结点开始向后移动一条*/
{
strcpy(t[j+1].name,t[j].name); /*当前记录的姓名拷贝到后一条*/
strcpy(t[j+1].units,t[j].units); /*当前记录的单位拷贝到后一条*/
strcpy(t[j+1].tele,t[j].tele); /*当前记录的电话拷贝到后一条*/
strcpy(t[j+1].product_company,t[j].product_company);
strcpy(t[j+1].designer,t[j].designer);
strcpy(t[j+1].price,t[j].price);
strcpy(t[j+1].kucun,t[j].kucun);
strcpy(t[j+1].year,t[j].year);
strcpy(t[j+1].month,t[j].month);
strcpy(t[j+1].day,t[j].day);
}
strcpy(t[i].name,temp.name); /*将新插入记录的姓名拷贝到第i个位置*/
strcpy(t[i].units,temp.units); /*将新插入记录的单位拷贝到第i个位置*/
strcpy(t[i].tele,temp.tele); /*将新插入记录的电话拷贝到第i个位置*/
strcpy(t[i].product_company,temp.product_company);
strcpy(t[i].designer,temp.designer);
strcpy(t[i].price,temp.price);
strcpy(t[i].kucun,temp.kucun);
strcpy(t[i].year,temp.year);
strcpy(t[i].month,temp.month);
strcpy(t[i].day,temp.day);
n++; /*记录数加1*/
return n; /*返回记录数*/
}
}
/*保存函数,参数为结构体数组和记录数*/
void save(ADDRESS t[],int n)
{
int i;
FILE *fp; /*指向文件的指针*/
if((fp=fopen("record.txt","wb"))==NULL) /*打开文件,并判断打开是否正常*/
{
printf("can not open file\n");/*没打开*/
exit(1); /*退出*/
}
printf("\nSaving file now!\n"); /*输出提示信息*/
fprintf(fp,"there is %d records!",n); /*将记录数写入文件*/
fprintf(fp,"\r\n"); /*将换行符号写入文件*/
for(i=0;in;i++)
{
fprintf(fp,"%s/%s/%s/%s/%s/%s/%s/%s/%s/%s",t[i].name,t[i].units,t[i].tele,t[i].product_company,t[i].designer,t[i].price,t[i].kucun,t[i].year,t[i].month,t[i].day);/*格式写入记录*/
fprintf(fp,"\r\n"); /*将换行符号写入文件*/
}
fclose(fp);/*关闭文件*/
printf("****save success***\n"); /*显示保存成功*/
}
/*读入函数,参数为结构体数组*/
/* int load(ADDRESS t[]) */
/* { */
/* int i,n; */
/* FILE *fp; *//*指向文件的指针*/
/* if((fp=fopen("record.txt","rb"))==NULL)*//* 打开文件*/
/* { */
/* printf("can not open file\n"); *//*不能打开*/
/* exit(1); *//*退出*/
/* } */
/* fscanf(fp,"%d",n);*/ /*读入记录数*/
/* for(i=0;in;i++) */
/* fscanf(fp,"%20s%30s%10s",t[i].name,t[i].units,t[i].tele); */ /*按格式读入记录*/
/* fclose(fp);*/ /*关闭文件*/
/* printf("You have success read data from file!!!\n"); *//* 显示保存成功*/
/* return n;*/ /*返回记录数*/
/* } */
/*按序号显示记录函数*/
int modify_kucun(ADDRESS t[],int n)
{
char s[20],ch[10]; /*保存待查找姓名字符串*/
int i,j; /*保存查找到结点的序号*/
/*clrscr(); */
printf("please input the cloth name which you wanted to modify its kucun:\n");
scanf("%s",s); /*输入待查找姓名*/
i=find(t,n,s); /*调用find函数,得到一个整数*/
if(in-1) /*如果整数i值大于n-1,说明没找到*/
printf("sorry!the name don't exist!\n");
else
{
print(t[i]); /*找到,调用显示函数显示记录*/
/*printf("Are you sure to modify its kucun?Yes--y/"); */
printf("please input the new kucun you want:\n");
scanf("%c",ch);
for(j=0;j10;j++)
t[i].kucun[j]=ch[j];
printf("Ok!the kucun has been modified!");
}
clrscr();
}
void display(ADDRESS t[])
{
int id,n;
FILE *fp; /*指向文件的指针*/
if((fp=fopen("record.txt","rb"))==NULL) /*打开文件*/
{
printf("can not open file\n"); /*不能打开文件*/
exit(1); /*退出*/
}
printf("Enter order number:\n"); /*显示信息*/
scanf("%d",id); /*输入序号*/
fscanf(fp,"%d",n); /*从文件读入记录数*/
if(id=0idn) /*判断序号是否在记录范围内*/
{
fseek(fp,(id-1)*sizeof(ADDRESS),1); /*移动文件指针到该记录位置*/
print(t[id]); /*调用输出函数显示该记录*/
printf("\r\n");
}
else
printf("no %d number record!!!\n ",id); /*如果序号不合理显示信息*/
fclose(fp); /*关闭文件*/
}
/*排序函数,参数为结构体数组和记录数*/
void sort(ADDRESS t[],int n)
{
int i,j,flag;
char y;
ADDRESS temp; /*临时变量做交换数据用*/
R: printf("Please select which kind to sort!0--sort by kucun/1--sort by Chu_Chang_Ri_Qi\n "); /*选择何种方式排序*/
if(getch()=='0')
{
for(i=0;in;i++)
{
flag=0; /*设标志判断是否发生过交换*/
for(j=0;jn-1;j++)
if((strcmp(t[j].kucun,t[j+1].kucun))0) /*比较大小*/
{
flag=1;
strcpy(temp.name,t[j].name); /*交换记录*/
strcpy(temp.units,t[j].units);
strcpy(temp.tele,t[j].tele);
strcpy(temp.product_company,t[j].product_company);
strcpy(temp.designer,t[j].designer);
strcpy(temp.price,t[j].price);
strcpy(temp.kucun,t[j].kucun);
strcpy(temp.year,t[j].year);
strcpy(temp.month,t[j].month);
strcpy(temp.day,t[j].day);
strcpy(t[j].name,t[j+1].name);
strcpy(t[j].units,t[j+1].units);
strcpy(t[j].tele,t[j+1].tele);
strcpy(t[j].product_company,t[j+1].product_company);
strcpy(t[j].designer,t[j+1].designer);
strcpy(t[j].price,t[j+1].price);
strcpy(t[j].kucun,t[j+1].kucun);
strcpy(t[j].year,t[j+1].year);
strcpy(t[j].month,t[j+1].month);
strcpy(t[j].day,t[j+1].day);
strcpy(t[j+1].name,temp.name);
strcpy(t[j+1].units,temp.units);
strcpy(t[j+1].tele,temp.tele);
strcpy(t[j+1].product_company,temp.product_company);
strcpy(t[j+1].designer,temp.designer);
strcpy(t[j+1].price,temp.price);
strcpy(t[j+1].kucun,temp.kucun);
strcpy(t[j+1].year,temp.year);
strcpy(t[j+1].month,temp.month);
strcpy(t[j+1].day,temp.day);
}
if(flag==0) break; /*如果标志为0,说明没有发生过交换循环结束*/
}
printf("sort sucess!!!\n"); /*显示排序成功*/
}
else
if(getch()=='1')
{
for(i=0;in;i++)
{
flag=0; /*设标志判断是否发生过交换*/
for(j=0;jn-1;j++)
/* if((()((strcmp(t[j].month,t[j+1].month))0)))
((strcmp(t[j].day,t[j+1].day))0))||
(((strcmp(t[j].year,t[j+1].year))=0)((strcmp(t[j].month,t[j+1].month))0))||
(((strcmp(t[j].year,t[j+1].year))=0)((strcmp(t[j].month,t[j+1].month))=0)((strcmp(t[j].day,t[j+1].day))0))) *//*比较大小*/
if(( ((strcmp(t[j].year,t[j+1].year))0)((strcmp(t[j].month,t[j+1].month))0)((strcmp(t[j].day,t[j+1].day))0) )||
( ((strcmp(t[j].year,t[j+1].year))==0)((strcmp(t[j].month,t[j+1].month))0) )||
( ((strcmp(t[j].year,t[j+1].year))==0)((strcmp(t[j].month,t[j+1].month))==0)((strcmp(t[j].day,t[j+1].day))0) ))
{
flag=1;
strcpy(temp.name,t[j].name); /*交换记录*/

我想自学财务管理软件的编程,请问各位大神需要具备什么样的条件
1、首先喜欢编程,喜欢才能把软件编好。
2、具有一定的基础,例如数学、英语等。对编程有一定基础后再从算法以及软件运行时的时间和空间上进行归纳总结。
3、根据自己实际情况选一到两门编程语言,多看例程多练习。对平常遇到的一些问题从编程角度想想怎么解决,多试试。
C语言编写一个软件?
1、首先打开pelles C,创建一个新的项目文件。
2、然后输入简单的框架。
3、接着用switch函数完成加减乘除操作。
4、检查输入之后就可以计算结果了。这里需要添加的代码如下,之后便可以运行了。
5、这里我们输入一个例子。
c语言财务软件怎么编写的介绍就聊到这里啦,感谢您花时间阅读本站内容,更多关于财务编程语言、c语言财务软件怎么编写的信息别忘了在本站进行查找喔。
猜你喜欢
- 2023-09-28现在好的财务软件有什么(现在好的财务软件有什么软件)
- 2023-09-28财务软件做账人员要求(速达3000财务软件做账流程)
- 2023-09-28学校财务软件教学工作总结(学校线上教学工作总结)
- 2023-09-28威海u8财务软件(u8财务软件怎么取消记账)
- 2023-09-28用友t3财务软件复制账套(用友t3怎么复制凭证到新的一张凭证)
- 2023-09-28用友财务软件和金蝶软件(用友财务软件和金蝶软件的区别)
- 2023-09-28航天金穗财务软件下载a3的简单介绍
- 2023-09-28博科u8财务软件报表(博科财务软件年度结账)
- 2023-09-28平顶山用友云财务软件(河南用友软件有限公司怎么样)
- 2023-09-28徐汇学财务软件学校(徐泾会计学院)
网友评论
- 随机文章
- 最新文章
- 侧栏广告位
-
- 热门文章
-
- win7系统安装sql2000数据库时没有反应,不出来安装界面?
- 用友T+教程_畅捷通T+视频教程_用友T+教程下载
- windows 7 操作系统安装用友财务软件的方法_win7怎么装用友软件?
- windows 10操作系统安装用友财务软件的方法_win10怎么装用友?
- 用友u8安装教程_用友U8安装步骤_用友U8软件安装教程
- 用友T+安装教程_怎么安装用友T+_畅捷通T+软件安装
- 用友U8的提取密码是什么?
- sql 2008 r2安装教程_sql server 2008安装图解_怎么安装sql 2008
- 用友u8v10.1免费下载_用友u8v10.1安装金盘
- 怎么安装用友T3财务软件的方法_用友通T3安装图文教程

