欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    c语言销售管理系统(共20页).docx

    • 资源ID:16308184       资源大小:42.93KB        全文页数:20页
    • 资源格式: DOCX        下载积分:20金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要20金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    c语言销售管理系统(共20页).docx

    精选优质文档-倾情为你奉上C语言销售管理系统课设满分作品带报表和折线图显示#include <stdio.h>#include <windows.h>#include <wincon.h>#include<string.h>#include<stdlib.h>#include<conio.h>#include<math.h>#define NULL 0CONSOLE_SCREEN_BUFFER_INFO csbiInfo;extern WINBASEAPI HWND WINAPI GetConsoleWindow();void input();/实现手动输入销售信息void menu();/程序菜单主界面显示void daoru(); /函数声明void seek();/销售信息查询void save();/销售信息保存void del();/销售信息删除void def();/销售信息初始化void history(people);/实现销售历史查询void clear();/实现清屏void filepath();/判断是否为默认文件位置,及询问是否要求修改文件位置void baobiao();/打印报表void txt(zx);/折线图void sxt(g1, g2, g3, g4, g5);/扇形图int ghj = 1;int file_choose = 0;/文件导入初始状态 /全局变量char filename30 = "sell.txt"/默认文件位置int price5 = 2, 2, 2, 2, 2 ; /默认商品价格struct goodint num;/产品编号int f_name10;/产品名称float price;/产品价格商品属性int date;/销售日期int sum;/销售数量 good5;/定义商品属性结构体,及五个商品struct sellerint num;/销售员编号char name8;/销售员姓名char sex;/销售员性别structgood good5;/五种商品 sell4; /定义销售员结构体,及四个销售员struct daystruct seller sell4; d31;struct yearstruct day d31; m12;int main(int argc, char* argv)int x = 0;x = MessageBox(NULL, "欢迎使用销售管理系统n作者:xxn班级:xxxx", "欢迎", MB_YESNO);if (x = 6) menu();return 0;/*函 数 名:daoru()*描 述:从文件导入数据*入口参数:无;*出口参数:无;*/void daoru()FILE *fp;int i, day, month;if (fp = fopen(filename, "r") = NULL)printf("文件不存在!");return;for (month = 0; month<12; month+)for (day = 0; day<31; day+)/把文件读取到内存中for (i = 0; i<4; i+)fscanf(fp, "%6d%6d%6d%6d%6dn", &mmonth.dday.selli.good0.sum, &mmonth.dday.selli.good1.sum, &mmonth.dday.selli.good2.sum, &mmonth.dday.selli.good3.sum, &mmonth.dday.selli.good4.sum);fclose(fp);/*函 数 名:inpit()*描 述:数据的手动输入*入口参数:无;*出口参数:无;*/void input()int i = 0, day = 0, x = 0, month = 0;filepath();daoru();/文件导入及判断printf("请输入要查找的日期如1 1即一月一日:");scanf("%d%d", &month, &day);month-;day-;/保持实际时间与数组一致printf("请输入销售人员编号:n1:xx 2:xx 3:xx 4:xx:");scanf("%d", &i);i-;printf("请输入具体要录入的商品种类15对应商品1-5:");/用于查找所需的具体数据scanf("%d", &x);x-;printf("输入销售数量:");scanf("%d", &mmonth.dday.selli.goodx.sum);printf("完成!");save();/*函 数 名:seek()*描 述:查找*入口参数:无;*出口参数:无;*/void seek()char ch;int i = 0, j = 0, choose = 0, day = 0, t = 0, all = 0, month;filepath();daoru();printf("请输入要查找的日期如1 1即一月一日:");scanf("%d%d", &month, &day);month-;day-;/保持实际时间与数组一致printf("请输入销售人员编号:n1:xx 2:xx 3:xx 4:xx:");scanf("%d", &i);i-;printf("请选择1,当天具体商品销售情况 2,当天该销售员销售情况:");scanf("%d", &choose);switch (choose)case 1: printf("请输入具体要查找的商品种类15对应商品1-5n"); scanf("%d", &t); t-; printf("该销售员这天销售本商品的数量为:%d", mmonth.dday.selli.goodt.sum);break;case 2: printf("产品代号n"); printf("1.牛奶 2.西瓜 3.苹果 4.白菜 5.萝卜 销售之和n"); for (j = 0; j<5; j+)all += mmonth.dday.selli.goodj.sum; printf("%-8d%-8d%-8d%-8d%-8d%-10dn", mmonth.dday.selli.good0.sum, mmonth.dday.selli.good1.sum, mmonth.dday.selli.good2.sum, mmonth.dday.selli.good3.sum, mmonth.dday.selli.good4.sum, all);default:break;/*函 数 名:baobiao()*描 述:打印报表*入口参数:无;*出口参数:无;*/void baobiao()char choose = 'y'int i, j, x = 0, a = 0, b = 0, mo = 0, th = 0, partsum = 0, month = 0, sj = 0;int day = 0, alldat = 0, partallsum5 = 0 ;int mx45 = 0 , mxsum = 0; /用于存放明细filepath();daoru();/读取数据及判断printf("请选择1销售数量报表 2销售额报表:");scanf("%d", &i);if (i = 1)for (i = 0; i<5; i+)pricei = 1;/利用价格为1时计算数量elsesj = 1;x = MessageBox(NULL, "是否使用内置价格?", "提示", MB_YESNO);if (x = 7)printf("请依次输入五种商品价格:");scanf("%d%d%d%d%d", &price0, &price1, &price2, &price3, &price4);/上次输入作为内置价格printf("输入两个月份及日期:例如3 15 12 6(前者早上到后者晚上):");scanf("%d%d%d%d", &mo, &a, &th, &b);a-;b-;/保持实际时间与数组一致mo-;th-;clear();if (sj = 0)printf("时间段:%d月%d日-%d月%d日的销售数量汇总报表n", mo + 1, a + 1, th + 1, 1 + b);elseprintf("时间段:%d月%d日-%d月%d日的销售额汇总报表n", mo + 1, a + 1, th + 1, 1 + b);printf("五种商品对应价格为:%d %d %d %d %dn", price0, price1, price2, price3, price4);printf("n产品代号及名称n");printf("姓名编号t1.牛奶t2.西瓜t3.苹果t4.白菜t5.萝卜t销售之和n");/计算间隔整月if (th - mo>0)for (month = mo + 1; month <= (th - 1); month+)for (day = 0; day<31; day+)for (i = 0; i<4; i+)for (j = 0; j <= 4; j+)mxij = mxij + mmonth.dday.selli.goodj.sum*pricej;/累加计算所有他的所有销售情况for (i = 0; i<5; i+)for (j = 0, partsum = 0; j<4; j+)partsum += mmonth.dday.sellj.goodi.sum*pricei;/统计同种商品数目,一维数组当天4个销售员 同种商品数目partallsumi += partsum;/间隔整月前一段for (day = a; day<31; day+)for (i = 0; i<4; i+)for (j = 0; j <= 4; j+)mxij = mxij + mmo.dday.selli.goodj.sum*pricej;/累加计算所有他的所有销售情况for (i = 0; i<5; i+)for (j = 0, partsum = 0; j<4; j+)partsum += mmo.dday.sellj.goodi.sum*pricei;partallsumi += partsum;/统计同种商品数目,一维数组当天4个销售员 同种商品数目/间隔整月后一段for (day = 0; day <= b; day+)for (i = 0; i<4; i+)for (j = 0; j <= 4; j+)mxij = mxij + mth.dday.selli.goodj.sum*pricej;/累加计算所有他的所有销售情况for (i = 0; i<5; i+)for (j = 0, partsum = 0; j<4; j+)partsum += mth.dday.sellj.goodi.sum*pricei;partallsumi += partsum;/统计同种商品数目,一维数组当天4个销售员 同种商品数目else if (th - mo) = 0)for (day = a; day <= b; day+)for (i = 0; i<4; i+)for (j = 0; j <= 4; j+)mxij = mxij + mmo.dday.selli.goodj.sum*pricej;/累加计算所有他的所有销售情况for (i = 0; i<5; i+)for (j = 0, partsum = 0; j<4; j+)partsum += mmo.dday.sellj.goodi.sum*pricei;partallsumi += partsum;/统计同种商品数目,一维数组当天4个销售员 同种商品数目/输出报表for (i = 0; i<4; i+)printf("%-6s ", selli.name);/销售员姓名for (j = 0; j<5; j+)printf("t%d", mxij);mxsum += mxij;/二维数组记录销售员printf("t%dn", mxsum);mxsum = 0;/用于下次循环 的初始化/输出表格同类商品总计printf("同类商品");for (i = 0; i<5; i+)printf("t%d", partallsumi);/统计同种商品数目,一维数组alldat += partallsumi;/合计所有的商品printf("t合计:%d", alldat);/所有商品合计x = MessageBox(NULL, "是否打印扇形形图?", "提示", MB_YESNO);if (x = 6)clear();printf("时间段:%d月%d日-%d月%d日", mo + 1, a + 1, th + 1, 1 + b);printf(" 销售扇形图");sxt(partallsum0, partallsum1, partallsum2, partallsum3, partallsum4);/*函 数 名:del()*描 述:删除*入口参数:无;*出口参数:无;*/void del()int i = 0, day = 0, x = 0, month;int choose;filepath();daoru();printf("请输入要查找日期如1月1日 输入1 1:");scanf("%d%d", &month, &day);month-;day-;/保持实际时间与数组一致printf("请输入销售人员编号:n1:xx 2:xx 3:xx 4:xx:");scanf("%d", &i);i-;printf("请选择1.删除该销售员整天的销售信息 2.具体商品销售信息:");scanf("%d", &choose);switch (choose)case 1: for (x = 0; x<5; x+)mmonth.dday.selli.goodx.sum = 0;break;case 2: printf("请输入具体要删除的商品种类15对应商品1-5 :"); scanf("%d", &x); x-; mmonth.dday.selli.goodx.sum = 0;break;default:break;printf("已删除指定销售员信息");save();/*函 数 名:def()*描 述:销售数据初始化*入口参数:无;*出口参数:无;*/void def()FILE *fp;int i, day, month;filepath();fp = fopen(filename, "w");for (month = 0; month<12; month+)for (day = 0; day<31; day+)for (i = 0; i<4; i+) /保存信息到文件fprintf(fp, "%-6d%-6d%-6d%-6d%-6dn", mmonth.dday.selli.good0.sum = 0, mmonth.dday.selli.good1.sum = 0, mmonth.dday.selli.good2.sum = 0, mmonth.dday.selli.good3.sum = 0, mmonth.dday.selli.good4.sum = 0);fprintf(fp, "n");/日期间隔printf("初始化操作完成!");fclose(fp);/*函 数 名:filepath()*描 述:判断及修改文件位置*入口参数:无;*出口参数:无;*/void filepath()char choose;int x;clear();if (file_choose = 0)x = MessageBox(NULL, "现在为默认文件n是否使用?", "提示", MB_YESNO);if (x = 7)printf("请输入文件绝对路径:");fflush(stdin);gets(filename);file_choose = 1;/其他位置文件 标志elsex = MessageBox(NULL, "不在提醒?", "提示", MB_YESNO);if (x = 6)file_choose = 2;/其他位置文件 标志printf("设置成功n");/*函 数 名:save()*描 述:保存数据*入口参数:无;*出口参数:无;*/void save(people)FILE *fp;intday, i, month;fp = fopen(filename, "w");for (month = 0; month<12; month+)for (day = 0; day<31; day+)for (i = 0; i<4; i+)fprintf(fp, "%-6d%-6d%-6d%-6d%-6dn", mmonth.dday.selli.good0.sum, mmonth.dday.selli.good1.sum, mmonth.dday.selli.good2.sum, mmonth.dday.selli.good3.sum, mmonth.dday.selli.good4.sum);fprintf(fp, "n");/写入文件fclose(fp);/*函 数 名:clear()*描 述:清屏*入口参数:无;*出口参数:无;*/void clear()int i;HWND hwnd;HANDLE hOut;HDC hdc, hdc1;HPEN ypn, p_pn, p1_pn, p2_pn, p3_pn, p4_pn, p5_pn;HPEN hPen, hOldPen;HBRUSH hBrush, hOldBrush, hbr;COORD pos = 1, 4 ;hwnd = GetConsoleWindow();hdc = GetDC(hwnd);hOut = GetStdHandle(STD_OUTPUT_HANDLE);hbr = CreateSolidBrush(RGB(0, 0, 0);SelectObject(hdc, hbr);Rectangle(hdc, 0, 65, 670, 470);SetConsoleCursorPosition(hOut, pos);for (i = 0; i<19; i+)printf(" n ");SetConsoleCursorPosition(hOut, pos);Rectangle(hdc, 0, 65, 670, 470);ReleaseDC(hwnd, hdc);/*函 数 名:history()*描 述:历史销售查询*入口参数:people;*出口参数:无;*/void history(people)int i, j, x = 0, a = 0, b = 0, mo = 0, th = 0, partsum = 0, month = 0;int day = 0, sumall = 0, more = 1;int mx6 = 0 ; /用于存放明细char choose;filepath();daoru();clear();printf("输入两个月份及日期:例如7 15 12 6(前者早上到后者晚上):");scanf("%d%d%d%d", &mo, &a, &th, &b);a-;b-;/保持实际时间与数组一致mo-;th-;printf("销售员:%s 时间段:%d月%d日-%d月%d日n", sellpeople.name, mo + 1, a + 1, th + 1, 1 + b);printf("日期 t1.牛奶t2.西瓜t3.苹果t4.白菜t5.萝卜t销售之和n");if (th - mo>0)/间隔整月前一段for (day = a; day<31; day+)if (more >= 16)x = MessageBox(NULL, "是否显示更多?", "提示", MB_YESNO);if (x = 6)clear();printf("日期 t1.牛奶t2.西瓜t3.苹果t4.白菜t5.萝卜t销售之和n");more = 0;else goto end;printf("%d月%d日 ", mo + 1, day + 1);for (j = 0; j <= 4; j+)sumall += mmo.dday.sellpeople.goodj.sum;printf("t%d", mmo.dday.sellpeople.goodj.sum);mxj += mmo.dday.sellpeople.goodj.sum;printf("t%dn", sumall);more+;mx5 += sumall;sumall = 0;/计算间隔整月for (month = mo + 1; month <= (th - 1); month+)for (day = 0; day<31; day+)if (more >= 16)x = MessageBox(NULL, "是否显示更多?", "提示", MB_YESNO);if (x = 6)clear();printf("日期 t1.牛奶t2.西瓜t3.苹果t4.白菜t5.萝卜t销售之和n");more = 0;else goto end;printf("n%d月%d日 ", month + 1, day + 1);for (j = 0; j <= 4; j+)sumall += mmonth.dday.sellpeople.goodj.sum;printf("t%d", mmonth.dday.sellpeople.goodj.sum);mxj += mmonth.dday.sellpeople.goodj.sum;printf("t%d", sumall);more+;mx5 += sumall;sumall = 0;/间隔整月后一段for (day = 0; day <= b; day+)if (more >= 16)x = MessageBox(NULL, "是否显示更多?", "提示", MB_YESNO);if (x = 6)clear();printf("日期 t1.牛奶t2.西瓜t3.苹果t4.白菜t5.萝卜t销售之和n");more = 0;else goto end;printf("n%d月%d日 ", th + 1, day + 1);for (j = 0; j <= 4; j+)sumall += mth.dday.sellpeople.goodj.sum;printf("t%d", mth.dday.sellpeople.goodj.sum);mxj += mth.dday.sellpeople.goodj.sum;printf("t%d", sumall);more+;mx5 += sumall;sumall = 0;/一个月内时间段else if (th - mo) = 0)for (day = a; day <= b; day+)if (more >= 18)x = MessageBox(NULL, "是否显示更多?", "提示", MB_YESNO);if (x = 6)clear();printf("日期 t1.牛奶t2.西瓜t3.苹果t4.白菜t5.萝卜t销售之和n");more = 0;else goto end;printf("%d月%d日 ", mo + 1, day + 1);for (j = 0; j <= 4; j+)sumall += mmo.dday.sellpeople.goodj.sum;printf("t%d", mmo.dday.sellpeople.goodj.sum);mxj += mmo.dday.sellpeople.goodj.sum;printf("t%dn", sumall);more+;mx5 += sumall;sumall = 0;end:printf("n合计: ");for (j = 0; j <= 4; j+)printf("t%d", mxj);printf("t总计:%dn完成!", mx5);x = MessageBox(NULL, "是否打印条形图?", "提示", MB_YESNO);if (x = 6)clear();printf("销售员:%s 时间段:%d月%d日-%d月%d日n", sellpeople.name, mo + 1, a + 1, th + 1, 1 + b);printf("nnnn 历史销售统计条形图");for (j = 0; j <= 4; j+)txt(mxj);

    注意事项

    本文(c语言销售管理系统(共20页).docx)为本站会员(飞****2)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开