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

上传人:牧羊曲112 文档编号:3450916 上传时间:2023-03-13 格式:DOCX 页数:6 大小:37.71KB
返回 下载 相关 举报
小型书店进销存管理系统程序实验报告.docx_第1页
第1页 / 共6页
小型书店进销存管理系统程序实验报告.docx_第2页
第2页 / 共6页
小型书店进销存管理系统程序实验报告.docx_第3页
第3页 / 共6页
小型书店进销存管理系统程序实验报告.docx_第4页
第4页 / 共6页
小型书店进销存管理系统程序实验报告.docx_第5页
第5页 / 共6页
亲,该文档总共6页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《小型书店进销存管理系统程序实验报告.docx》由会员分享,可在线阅读,更多相关《小型书店进销存管理系统程序实验报告.docx(6页珍藏版)》请在三一办公上搜索。

1、小型书店进销存管理系统程序实验报告 小型书店进销存管理系统程序实验报告 #include #include #include using 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;/折扣

2、 double day_saleprice;/日销售额 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 sh

3、u1; int check_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

4、_store);/读出文件 coutcheck_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; cou

5、t更新数据:endl; cout所进购书的信息: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);/写入文件 else coutit is error!endl; void shu:shu_check;/查询书数据 iofile

6、.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_priceendl; cout书售价:;coutshu1.sale_priceendl; coutshu1.sale_amount; coutshu1.sale_day;

7、 iofile.write(char*)&shu1,sizeof(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_amou

8、ntendl; cout书进价:;coutshu1.shu_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_

9、store);/读出文件 coutcheck_shuhao; 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_salepriceen

10、dl; iofile.write(char*)&shu1,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_amoun

11、tendl; cout书进价:;coutshu1.shu_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 sh

12、u1.day_saleprice=shu1.sale_amount*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.shumi

13、ngendl; cout书的销售量:;coutshu1.sale_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.进书数据

14、输入endl; cout2.增书数据输入endl; cout3.书日销售额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;

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号