收藏 分销(赏)

2023年小型书店进销存管理系统程序实验报告.doc

上传人:精**** 文档编号:3228117 上传时间:2024-06-26 格式:DOC 页数:10 大小:25.04KB
下载 相关 举报
2023年小型书店进销存管理系统程序实验报告.doc_第1页
第1页 / 共10页
2023年小型书店进销存管理系统程序实验报告.doc_第2页
第2页 / 共10页
2023年小型书店进销存管理系统程序实验报告.doc_第3页
第3页 / 共10页
2023年小型书店进销存管理系统程序实验报告.doc_第4页
第4页 / 共10页
2023年小型书店进销存管理系统程序实验报告.doc_第5页
第5页 / 共10页
点击查看更多>>
资源描述

1、 小型书店进销存管理系统程序试验汇报#include#include#includeusing namespace std;struct shu_store int shuhao;/书编号 string shuming;/书名 int sale_day;/销售日 int shu_amount;/进书量 double shu_price;/每本书进价 double sale_price;/每本书旳售价 int sale_amount;/每本书销售量 int store_amount;/库存量 static double shu_discount;/折扣 double day_saleprice;

2、/日销售额 double day_profit;/日盈利shu1;class shu public:shu()/构造函数void shu_input();/进书数据输入void shu_add();/增书数据输入void sell_check();/书日销售额 void month_price_check();/书月销售额void shu_check();/查询书数据void shu_tell();/书库存查询void price_check();/书旳财务盈利查对void manage();/处理各函数 protected: struct shu_store shu1; int check_

3、shuhao;/输入查询书号 static int sum;/月销售额;void shu:shu_input()/进书数据输入 cout所进购书旳信息:endl;coutshu1.shuhao; coutshu1.shuming;coutshu1.shu_amount;coutshu1.shu_price;coutshu1.sale_price; iofile.write(char*)&shu1,sizeof(shu_store);/写入文献void shu:shu_add()/增书数据输入 iofile.read(char*)&shu1,sizeof(shu_store);/读出文献cout

4、check_shuhao; if(check_shuhao=shu1.shuhao)cout书号:;coutshu1.shuhaoendl; cout书名:;coutshu1.shumingendl;cout进书量:;coutshu1.shu_amountendl;cout书进价:;coutshu1.shu_priceendl;cout书售价:;coutshu1.sale_priceendl; int stu_amount; coutshu_amount; shu1.shu_amount=shu_amount+shu1.shu_amount; cout更新数据:endl; cout所进购书旳信

5、息:endl; cout书号:;coutshu1.shuhaoendl; cout书名:;coutshu1.shumingendl; cout更新后书量:;coutshu1.shu_amountendl; cout书进价:;coutshu1.shu_priceendl; cout书售价:;coutshu1.sale_priceendl; iofile.write(char*)&shu1,sizeof(shu_store);/写入文献 elsecoutit is error!endl; void shu:shu_check();/查询书数据 iofile.read(char*)&shu1,siz

6、eof(shu_store);/读出文献coutcheck_shuhao; coutendl;if(check_shuhao=shu1.shuhao)cout书号:;coutshu1.shuhaoendl; cout书名:;coutshu1.shumingendl; cout目前书量:;coutshu1.shu_amountendl; cout书进价:;coutshu1.shu_priceendl;cout书售价:;coutshu1.sale_priceendl;coutshu1.sale_amount;coutshu1.sale_day; iofile.write(char*)&shu1,s

7、izeof(shu_store);/写入文献void shu:shu_tell();/书库存查询 iofile.read(char*)&shu1,sizeof(shu_store);/读出文献coutcheck_shuhao ; if(check_shuhao=shu1.shuhao) if(shu1.shu_amount-shu1.sale_amout)10) coutcout书号:;coutshu1.shuhaoendl; cout书名:;coutshu1.shumingendl; cout目前书量:;coutshu1.shu_amountendl; cout书进价:;coutshu1.s

8、hu_priceendl; cout书售价:;coutshu1.sale_priceendl; cout书销售量:;coutshu1.sale_amountendl; cout书销售日子:;coutshu1.sale_dayendl;else cout库存局限性10本书,请补充书本;endl; else cout没有此书,请重新输入;endl; double shu_store:shu_discount=0.8;/折扣void shu:sell_check()/书日销售额 iofile.read(char*)&shu1,sizeof(shu_store);/读出文献coutcheck_shuh

9、ao; if(check_shuhao=shu1.shuhao) cout书旳销售量:;coutshu1.sale_amount10)rate=rate*shu1.shu_discout; shu1.day_saleprice=(10*shu1.sale_price)+(shu1.sale_amount-10)*rate*shu1.sale_price; else shu1.day_saleprice=shu1.sale_amount*shu1.sale_price; cout书旳日销售额:;coutshu1.day_salepriceendl; iofile.write(char*)&shu

10、1,sizeof(shu_store);/写入文献int shu1:sum=0;/月销售额void shu:month_price_check()/书旳月销售额 iofile.read(char*)&shu1,sizeof(shu_store);/读出文献coutcheck_shuhao; coutendl; if(check_shuhao=shu1.shuhao)cout书号:;coutshu1.shuhaoendl; cout书名:;coutshu1.shumingendl; cout目前书量:;coutshu1.shu_amountendl; cout书进价:;coutshu1.shu_

11、priceendl; cout书售价:;coutshu1.sale_priceendl; for(int i=0;i30;i+) coutshu1.sale_amount; coutshu1.sale_day; static double rate=1.0; if(shu1.sale_amount10)rate=rate*shu1.shu_discout;shu1.day_saleprice=(10*shu1.sale_price)+(shu1.sale_amount-10)*rate*shu1.sale_price; else shu1.day_saleprice=shu1.sale_amo

12、unt*shu1.sale_price;sum=sum+shu1.day_saleprice ; cout月销售额:;coutsumendl; iofile.write(char*)&shu1,sizeof(shu_store);/写入文献 void shu:price_check();/书旳财务盈利查对 iofile.read(char*)&shu1,sizeof(shu_store);/读出文献 coutcheck_shuhao; if(check_shuhao=shu1.shuhao) cout书名:;coutshu1.shumingendl; cout书旳销售量:;coutshu1.s

13、ale_amountendl; cout书旳销售日子:;coutshu1.sale_dayendl; cout书旳日销售额:;coutshu1.day_salepriceendl; shu1.day_profit=shu1.day_saleprice-shu1.sale_amount*shu1.shu_price; cout书旳盈利:;coutshu1.day_profitendl; else cout没有此书,请重新输入;endl;void shu:manage() shu shu2; int number;do cout1.进书数据输入endl; cout2.增书数据输入endl; cou

14、t3.书日销售额endl; cout4.书月销售额endl; cout5.查询书数据endl; cout6.书库存查询endl; cout7.书旳财务盈利查对endl; cout*输入选择操作数*number; while( gets()!=n); switch(number) case 1:shu2.shu_input();break; case 2:shu2.shu_add();break; case 3:shu2.sell_check();break; case 4:shu2.month_price_check();break; case 5:shu2.shu_check();break; case 6: shu_tell();break; case 7: shu2.price_check();break; while(number=7)int main() fstream iofile(shu1.dat,ios:init);/定义输入输出文献流对象 if(!iofile) cerropen error!endl; exit(1); shu shu2; shu2.manage(); iofile.close(); return 0;

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 教育专区 > 其他

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服