销售信息管理系统课程设计报告

销售信息管理系统课程设计报告本文简介:C语言课程设计C语言程序设计课程设计报告课设题目:销售信息统计管理系统班级:姓名:学号:指导教师:成绩:2013年6月C语言课程设计一、任务描述本次任务要求完成一个销售信息管理统计系统。具体内容为:假定某公司有n个销售员,负责销售m种产品。每个销售员将当天销售的每种产品一张便条的形式提交给公司。每张
销售信息管理系统课程设计报告本文内容:
C语言课程设计
C语言程序设计
课程设计报告
课设题目:
销售信息统计管理系统
班
级:
姓
名:
学
号:
指导教师:
成
绩:
2013
年
6
月
C语言课程设计
一、
任务描述
本次任务要求完成一个销售信息管理统计系统。具体内容为:假定某公司有n个销售员,负责销售m种产品。每个销售员将当天销售的每种产品一张便条的形式提交给公司。每张便条内容包括:(1)销售员编号;(2)销售产品代号;(3)产品销售量;(4)产品销售金额。本销售信息管理统计系统是对所收集的便条进行统计。具体要求如下:
(一)系统以菜单方式工作,要求界面清晰,便于操作。
(二)可以将每张便条输入,并以结构数组形式保存信息。
(三)能够查看输入的便条的内容。
(四)可以实现业绩查询功能,包括以下三种查询方式:
1.查询本月某个销售员某种产品的月销售额
2.查询某销售员月总销售额
3.查询某个销售员每种产品销售额
(五)统计产品热销度,并按从高到低的顺序排序加以显示
(六)生成销售统计报表
二、
系统概要设计
(一)模块整体设计图
销售信息统计管理系统
菜单显示
录入便条
读出便条
查询业绩
热销度统计
统计报表
图1
模块调用图
月销售额查询
月总销售额查询
产品销售额查询
(二)函数功能介绍
1.主函数void
main()
功能:调用其他各个函数;
2.菜单函数
void
menu()
功能:构造系统界面;
3.录入函数
void
input()
功能:输入数据并用结构数组保存;
4.读取函数
void
output()
功能:查看之前录入的数据,并以表格形式输出;
5.
查询函数由以下四部分构成
(1)查询函数界面void
menu1()
功能:构造查询界面,并调用其他查询函数
(2)查询函数1
void
search1()
功能:查询本月某个销售员某种产品的月销售额
(3)查询函数2
void
search2()
功能:查询某销售员月总销售额
(4)查询函数3
void
search3()
功能:查询某个销售员每种产品销售额
6.
产品销售量统计函数array()
功能:统计每种产品销售量
7.
统计函数
void
count()
功能:统计每种产品的销售量,并从高到低输出;
8.
统计报表函数
void
form()
功能:以统计报表形式将所有数据显示出来;
三、
系统详细设计
(一)数据结构设计
1.本系统采用结构体数组保存所录入的便条信息,其中,每张便条的结构体如下:
struct
paper
{
int
num;
int
pnum;
int
pcount;
float
money;
}staff[MAX+1];
2.定义如下结构体用来将所有产品的销售额进行统计处理并按序存放,其结构体如下:
struct
sum
{
int
pnum;
int
pcount;
float
psale;
}product[MAX+1];
3.定义静态全局变量note,用以统计输入的便条数。
(二)模块接口设计:
1.
各函数原型为:
main();
/*主函数*/
void
menu();
/*菜单函数*/
void
input();
/*录入函数*/
void
output();
/*读取函数*/
void
menu1();
/*查询菜单函数*/
void
search1();
/*查询月销售额函数*/
void
search2();
/*查询月总销售额函数*/
void
search3();
/*查询产品销售额函数*/
void
array();
/*统计产品销售量函数*/
void
count();
/*统计产品热销售度函数*/
void
form();
/*生成统计报表函数*/
2.系统界面切换的实现
每个函数在返回上一个菜单时,均采用switch语句进行选择,例如:
printf(“\n\nWhat
do
you
want
to
do?
1>Return
to
menu
0>Exit
system“);
printf(“\n\nPlease
make
choices(0-1):“);
scanf(“%d“,switch(ch)
{
case
1:menu();break;
case
0:exit(0);break;
}
}
在main()函数中用do-while语句实现各函数的循环调用,以使各功能能够重复实现,直至用户退出系统为止
(三)盒图:
1.主函数盒图:
图2
主函数盒图
调用menu()
输入ch
ch之值
1
input()
2
3
4
5
0
output()
menu1()
count()
form()
exit(0)
直到ch=0
2.录入函数盒图
输入员工编号staff[i].num
staff[i].num=-1
跳出循环体
输入便条上其他信息
Y
N
note++
i++
退出
回到主菜单
图3
录入函数盒图
0
1
输出提示信息,输入ch
调用clrscr();
i=1
打印界面标题和提示信息
3.
查询菜单函数盒图
输入ch
0
4
1
3
2
退出
回到主菜单
查询3
查询2
查询1
图4
查询菜单函数盒图
4.
查询功能盒图(以查询月销售额函数为例)
i=1
输入sn
sn=-1
N
Y
j=1
当j
#include
/*屏幕操作函数*/
#define
MAX
20
#define
N
5
#define
M
5
void
menu();
/*函数声明*/
void
input();
void
output();
void
menu1();
void
search1();
void
search2();
void
search3();
void
array();
void
count();
void
form();
static
int
note=0;
/*静态全局变量note用以统计便条数量*/
struct
paper
/*结构体数组用于存放便条信息*/
{
int
num;
int
pnum;
int
pcount;
float
money;
}staff[MAX+1];
struct
sum
/*结构体数组用于存放产品信息*/
{
int
pnum;
int
pcount;
float
psale;
}product[MAX+1];
main()
{
int
ch;
menu();
do
{
scanf(“%d“,switch(ch)
{
case
1:
input();break;
case
2:
output();break;
case
3:
menu1();break;
case
4:
count();break;
case
5:
form();break;
case
0:
exit(0);
}
}while(ch);
getch();
}
void
menu()
/*菜单函数*/
{
clrscr();
printf(“\n\t\t\t****Wecolme
to
Sales
Information
System****“);
printf(“\n\n\t\t\t
1.
Input
sales
information
“);
printf(“\n\n\t\t\t
2.
Look
over
the
information“);
printf(“\n\n\t\t\t
3.
Sales
inquery
“);
printf(“\n\n\t\t\t
4.
Products
sell
degree
statistic“);
printf(“\n\n\t\t\t
5.
Sales
form
“);
printf(“\n\n\t\t\t
0.
Exit
system“);
printf(“\n\nPlease
make
choices(0-5):“);
}
void
input()
/*录入函数*/
{
int
i,ch;
float
t;
clrscr();
printf(“\n\n\t\t****Input
sales
information****\n\n“);
printf(“Salesman
Numbers(
Return
to
menu
0>Exit
system“);
printf(“\n\nPlease
make
choices(0-1):“);
scanf(“%d“,switch(ch)
{
case
1:menu();break;
case
0:exit(0);break;
}
}
void
output()
/*读取函数*/
{
int
i,ch;
clrscr();
printf(“\n\t\t\t****Sales
information***\n\n“);
printf(“Salesman
Numbers
Product
code
Productsales
Sales
\n\n”);
for(i=1;iReturn
to
menu
0>Exit
system“);
printf(“\n\nPlease
make
choices(0-1):“);
scanf(“%d“,switch(ch)
{
case
1:menu();break;
case
0:exit(0);break;
}
}
void
menu1()
/*查询函数界面*/
{
int
ch;
clrscr();
printf(“\n\t\t\t****Sales
inquery****“);
printf(“\n\n\t\t\t
1.
A
salesman
some
product
inquiry
“);
printf(“\n\n\t\t\t
2.
A
salesman
monthly
sales
inquery“);
printf(“\n\n\t\t\t
3.
A
salesman
every
product
sales
“);
printf(“\n\n\t\t\t
4.
Return
to
menu“);
printf(“\n\n\t\t\t
0.
Exit
system“);
printf(“\n\nPlease
make
choices(0-3):“);
scanf(“%d“,switch(ch)
{
case
1:search1();break;
case
2:search2();break;
case
3:search3();break;
case
4:menu();break;
case
0:exit(0);break;
}
}
void
search1()
/*查询月销售额函数*/
{
int
i,sn,pn,ch,j;
float
su[MAX+1];
clrscr();
printf(“\n\n\t\t****
A
salesman
some
product
inquiry****\n\n“);
printf(“\nPlease
input
the
salesman
number
and
product
code
:“);
printf(
“\nSalesman
Numbers(
Return
to
inqury
0>Exit
system“);
printf(“\n\nPlease
make
choices(0-1):“);
scanf(“%d“,switch(ch)
{
case
1:menu1();break;
case
0:exit(0);break;
}
}
void
search2()
/*查询月总销售额函数*/
{
int
i,sn,ch,j,k=0;
float
su[MAX+1];
clrscr();
printf(“\n\n\t\t****
A
salesman
monthly
sales
inquery****\n\n“);
printf(“Please
input
the
salesman
number
:“);
printf(
“\n\nSalesman
Numbers(
Return
to
inqury
0>Exit
system“);
printf(“\n\nPlease
make
choices(0-1):“);
scanf(“%d“,switch(ch)
{
case
1:menu1();break;
case
0:exit(0);break;
}
}
void
search3()
/*查询产品销售额函数*/
{
int
i,sn,ch,j,k;
float
psale[MAX+1];
clrscr();
printf(“\n\n\t\t****
A
salesman
every
product
sales****\n\n“);
printf(“\n\nPlease
input
the
salesman
number
:“);
printf(
“\n\nSalesman
Numbers(
Return
to
inqury
0>Exit
system“);
printf(“\n\nPlease
make
choices(0-1):“);
scanf(“%d“,switch(ch)
{
case
1:menu1();break;
case
0:exit(0);break;
}
}
void
array()
/*统计产品销售量函数*/
{
int
i,j;
clrscr();
for(i=1;iReturn
to
menu
0>Exit
system“);
printf(“\n\nPlease
make
choices(0-1):“);
scanf(“%d“,switch(ch)
{
case
1:menu();break;
case
0:exit(0);break;
}
}
void
form()
/*生成统计报表函数*/
{
int
i,j,ch,k;
float
psale[MAX+1],s[MAX]={0.0},su=0.0;
array();
clrscr();
printf(“\n\n\t\t\t****
Sales
form****\n\n“);
printf(“\n\t\t\tSales
count
form\n\n“);
printf(“\t\t
Product
codes\t\t\tSales
sum\n\n“);
for(i=1;iReturn
to
menu
0>Exit
system“);
printf(“\n\nPlease
make
choices(0-1):“);
scanf(“%d“,switch(ch)
{
case
1:menu();break;
case
0:exit(0);break;
}
}
