班费管理系统c内容摘要:

((char*)amp。 data1[i],sizeof(data))。 ()。 int p=1,s1。 while(p) { cout请输入要插入的位置 :endl。 cins1。 if(s1=0amp。 amp。 s1=i) { for(s=i1。 s=s1。 s) //向后移一个结构体位置 data1[s+1]=data1[s]。 p=0。 } else cout输入错误 endl。 } cout请 输入插入的班费信息 endl。 //从键盘上读入信息 cout 班费编号 :。 cin。 cout 班费名称 :。 cin。 cout 花费金额 :。 cin。 cout 收入金额 :。 cin。 cout 经手人姓名 :。 cin。 cout 收支日期 :。 cin。 data1[s1]=dat。 ofstream out(,ios::binary)。 if(!out) { cerr数据文件打开失败。 endl。 exit(1)。 } coutsetfill(39。 ^39。 )setw(75)^endl。 coutsetiosflags(ios::right)setfill(39。 39。 )setw(10) 班费编号 setfill(39。 39。 )setw(12)班费名称 setfill(39。 39。 )setw(12)花费金额 setfill(39。 39。 )setw(12)收入金额 setfill(39。 39。 )setw(15)经手人姓名 setfill(39。 39。 )setw(12)收支日期 endl。 for(int j=0。 ji。 j++) //把新输入的信息放进磁盘 { ((char*)amp。 data1[j],sizeof(data))。 play(data1[j])。 } coutsetfill(39。 ^39。 )setw(75)^endl。 ()。 cout插入完毕 endl。 cout是否继续插入班费信息 (y/n)?endl。 cinb。 } } void find_menu()//查找菜单函数 { cout endl。 cout 查找班费信息 endl。 cout endl。 cout endl。 cout endl。 } void Manage::find()//查找班费信息 { data data1[20]。 //定义结构体数组 data1[20] char day[12]。 //定义字符数组 ,存放日期 int n。 int num。 char h。 cout是否确定查找 (y/n)?:。 cinh。 cout endl。 while(h==39。 Y39。 ||h==39。 y39。 ) { while(n) { find_menu()。 //调用查找信息菜单 cout请输入查找方式 :endl。 cinn。 if(n==1) //按编号查找班费信息 { cout请输入查找的班费信息编号 :。 cinnum。 ifstream in(,ios::binary)。 if (!in) { cerr数据文件打开失败 !endl。 exit(1)。 } coutsetfill(39。 ^39。 )setw(75)^endl。 coutsetiosflags(ios::right)setfill(39。 39。 )setw(10)班费编号 setfill(39。 39。 )setw(12)班费名称 setfill(39。 39。 )setw(12)花费金额 setfill(39。 39。 )setw(12)收入金额 setfill(39。 39。 )setw(15)经手人姓名 setfill(39。 39。 )setw(12)收支日期 endl。 for(int i=0。 !()。 i++) //从磁盘上读信息,直到结束 ((char*)amp。 data1[i],sizeof(data))。 ()。 for(int s1=0。 s1i1。 s1++) if(num==data1[s1].num) { play(data1[s1])。 coutsetfill(39。 ^39。 )setw(75)^endl。 continue。 } system(pause)。 //调用系统函数 } else if(n==2) //按日期查找班费信息 { cout请输入查找班费信息的日期 :。 cinday。 ifstream in(,ios::binary)。 if(!in) { cerr数据文件打开失败。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。