c語言營銷模式,C語言銷售管理系統

本文目錄一覽:

c語言到底是學什麼的呢 我是市場營銷系的 請問我應該學什麼

你去學 SPSS 去,趕快去吧。PPT學學也好。

市場營銷用不到C。

除非有一天,你去做IT了。還是IT里的programmer。

C是用來寫程序的。

Marketing只要用程序就可以了,用的還是市場營銷相關的程序。

例如SPSS就是一個很基礎很基本的市場調查用的統計軟件。

市場營銷其他要學的課除了那些基本的概念之外

品牌管理啊,廣告管理,消費者行為啊這些都得知道點概念,當然這些都是看看都明白,實踐才是真的,才要費功夫。哦,基礎的商用統計也要學一點兒。

如果你想做網站倒是可以考慮.net啊C#啊,這時候肯定要用到數據庫了。但是不做網站的話(外包就行了),數據庫都是可以不用學的。

C太基礎了,好比你是個作家,要用word寫書,你管word是什麼寫的么 有必要學寫一個word出來么,是吧?

當然,你要是有興趣,那學學是有益無害的。另外,一樣學C,推薦你不如學C++或者JAVA。比C好理解好上手好寫,用得也多。VB..感覺國內大學裡就C和VB多,從初中就教VB了,但其實VB有啥用呢…除了比C容易考過,不知道啊。

個人意見,我主修管理和計算機科學,輔修市場營銷。剛畢業。

C語言程序設計-服裝銷售系統

///////類似

/*計算上個月每個人每種產品的銷售額。

1)按銷售額對銷售員進行排序,輸出排序結果(銷售員代號)

2)統計每種產品的總銷售額,對這些產品按從高到底的順序,輸出排序結果(需輸出產品的代號和銷售額)

3)輸出統計報表如下:*/

#include stdio.h

#include string.h

#include conio.h

#include stdlib.h

#define Z 5

#define R 4 /*定義宏常量便於程序的一般化*/ /*R表示銷售員個數*/

typedef struct /*縮短結構體變量名*/

{

int shangpin[Z]; /*定義結構體便於信息的存儲和讀寫,辨別*/ /*R是表示商品的種類,最後一個為該銷售員商品總和*/

}data;

void menu()

{ printf(” *******************************************************\n”);

printf(” 0.結束操作\n”);

printf(” 1.計算上個月每個人每種產品的銷售額\n”);

printf(” 2.按銷售額對銷售員進行排序,輸出排序結果\n”);

printf(” 3.統計每種產品的總銷售額,輸出排序結果\n”);

printf(” 4.輸出統計報表\n”);

printf(” ******************************************************\n”);

}

void data_read(data *x) /*讀入函數使程序簡潔*/

{

FILE *fp;

char fname[10];

int i;

printf(“您想查詢哪個月?\n”);

printf(“請輸入月份:”); /*輸入文件名,這樣可以進行各個月份信息讀入*/

scanf(“%s”,fname);

strcat(fname,”.txt”);/*連接文件屬性*/

if((fp=fopen(fname,”rb”))==NULL) /*打開文件*/

{

printf(“can not open the file\n”);

exit(0);

}

for(i=0;iR;i++) /*讀出信息*/

if(fread(x+i,sizeof(data),1,fp)!=1)

printf(“讀入信息出錯!\n”);

}

void data_count(data *x) /*計算上個月每個人每種產品的銷售額*/

{

FILE *fp;

char fname[10];

int j,t; /*用於控制循環*/

int i,k,s; /*用於定義職工序號,產品序號,產品數量*/

system(“cls”);

printf(“您想計算哪個月?\n”);

printf(“請輸入月份:”); /*輸入文件名,這樣可以進行各個月份信息寫入*/

scanf(“%s”,fname);

strcat(fname,”.txt”);

if((fp=fopen(fname,”wb”))==NULL) /*打開文件*/

{

printf(“can not open the file\n”);

exit(0);

}

for(j=0;jR;j++) /*對商品數量清零*/

for(t=0;tZ;t++)

(x+j)-shangpin[t]=0;

printf(“please put the information about the 職工編號,產品編號,銷售數量\n”); /*寫入信息*/

for(j=0;;j++)

{

scanf(“%d%d%d”,i,k,s);

if(i==0) /*輸入職工為0時結束信息輸入*/

break;

if(iR||i0||kZ||k0)

{

printf(“the information error!\n”); /*避免輸入信息出錯*/

continue;

}

else

(x+i-1)-shangpin[k-1]=(x+i-1)-shangpin[k-1]+s;/*統計各個人的各種產品的數量,-1為了和數組中的序號相匹配*/

}

for(j=0;jR;j++)

if(fwrite((x+j),sizeof(data),1,fp)!=1) /*把信息寫入文件中便有以後調用*/

printf(“write error!\n”);

fclose(fp); /*關閉文件避免信息遺漏*/

}

void range_sxy(data *x) /*按銷售額對銷售員進行排序,輸出排序結果*/

{

FILE *fp;

char fname[10];

int i,k,j,t,bianhao[R]={0},z;

system(“cls”);

printf(“你要哪個月的?\n”);

printf(“請輸入月份:”); /*輸入文件名,這樣可以進行各個月份信息讀入*/

scanf(“%s”,fname);

strcat(fname,”.txt”);

if((fp=fopen(fname,”rb”))==NULL) /*打開文件*/

{

printf(“can not open the file\n”);

exit(0);

}

for(i=0;iR;i++) /*讀出信息*/

if(fread(x+i,sizeof(data),1,fp)!=1)

printf(“讀入信息出錯!”); /*讀入信息提示*/

for(i=0;iR;) /*用於存儲職工編號*/

bianhao[i]=i++;

printf(“請輸入按何種產品排序\n”);

scanf(“%d”,k);

k=k-1; /*便於與結構體中的數組值對應*/

for(i=0;iR;i++) /*按K種產品對銷售員排序,選擇法排序*/

{

t=i;

for(j=i+1;jR;j++)

if((x+bianhao[t])-shangpin[k](x+bianhao[j])-shangpin[k])/*調用職工各自對應的結構體內的產品數量*/

t=j;

if(t!=i)

{

z=bianhao[i];

bianhao[i]=bianhao[t];

bianhao[t]=z;

}

}

printf(“按%d產品對銷售員排序為:\n”,k+1);

for(i=0;iR;i++)

printf(“%5d”,bianhao[i]+1);

getch();

fclose(fp);

}

void range_shangpin(data *x) /*統計每種產品的總銷售額,輸出排序結果*/

{

FILE *fp;

char fname[10];

int i,j,sum[Z]={0},bianhao[Z]={0},z,t,k;

system(“cls”);

printf(“您想計算哪個月的?\n”);

printf(“請輸入月份:”); /*輸入文件名,這樣可以進行各個月份信息讀入*/

scanf(“%s”,fname);

strcat(fname,”.txt”);

if((fp=fopen(fname,”rb”))==NULL) /*打開文件*/

{

printf(“can not open the file\n”);

exit(0);

}

for(i=0;iR;i++) /*讀出信息*/

if(fread(x+i,sizeof(data),1,fp)!=1)

printf(“讀入信息出錯!”);

for(i=0;iZ;i++) /*對各種商品求和*/

for(j=0;jR;j++)

sum[i]=sum[i]+(x+j)-shangpin[i];

for(i=0;iZ;) /*用於存儲商品編號*/

bianhao[i]=i++;

for(i=0;iZ;i++)

printf(“%3d”,bianhao[i]);

for(i=0;iZ;i++) /*對產品從高到低排序,選擇法排序*/

{

t=i;

for(j=i+1;jZ;j++) /*產品變化時,產品編號也隨之變化,便於輸出*/

if(sum[t]sum[j])

t=j;

if(t!=i)

{

k=sum[i];

sum[i]=sum[t];

sum[t]=k;

z=bianhao[i];

bianhao[i]=bianhao[t];

bianhao[t]=z;

}

}

printf(“輸出產品排序\n”);

printf(“產品編號 數量\n”);

for(i=0;iZ;i++)

printf(“%-10d%-10d\n”,bianhao[i]+1,sum[i]);

getch();

fclose(fp);

}

void data_out(data *x) /*輸出統計報表*/

{

FILE *fp;

char fname[10];

int i,j,sum[Z+1]={0};

system(“cls”);

printf(“您想計算哪個月?\n”);

printf(“請輸入月份:”); /*輸入文件名,這樣可以進行各個月份信息讀入*/

scanf(“%s”,fname);

strcat(fname,”.txt”);

if((fp=fopen(fname,”rb”))==NULL) /*打開文件*/

{

printf(“can not open the file\n”);

exit(0);

}

for(i=0;iR;i++) /*讀出信息*/

if(fread(x+i,sizeof(data),1,fp)!=1)

printf(“讀入信息出錯!”);

for(i=0;iZ;i++) /*對各種商品求和*/

for(j=0;jR;j++)

sum[i]=sum[i]+(x+j)-shangpin[i];

for(i=0;iZ;i++) /*求商品總和*/

sum[Z]=sum[Z]+sum[i];

printf(“輸出統計報表如下:\n”); /*按要求輸出統計表*/

printf(“產品代號 銷售之和 銷售員代號\n”);

for(i=0;iR;i++)

for(j=0;jZ;j++)

printf(“%-10d%-10d%-10d\n”,j+1,(x+i)-shangpin[j],i+1);

printf(“***********************************\n”);

for(i=0;iZ;i++)

{

if(i==0)

printf(“%d產品之和 %-10d 總和 %-10d\n”,i+1,sum[i],sum[Z]);

else

printf(“%d產品之和 %-10d\n”,i+1,sum[i]);

}

getch();

}

void main()

{

int i,choice;

data sxy[R]; /*R表示職工的個數,前面的宏常量*/

for(i=0;;i++)

{

system(“cls”); /*清頻命令*/

menu(); /*菜單函數提示用戶怎樣選擇*/

printf(“你想做什麼?\n”);

printf(“請選擇:”); /*輸入要進行的操作*/

scanf(“%d”,choice);

if(choice==0) /*退出程序*/

break;

else

switch(choice)

{

case 1 : data_count(sxy);break; /*計算上個月每個人每種產品的銷售額*/

case 2 : range_sxy(sxy);break; /*按銷售額對銷售員進行排序,輸出排序結果*/

case 3 : range_shangpin(sxy);break; /*統計每種產品的總銷售額,輸出排序結果*/

case 4 : data_out(sxy);break; /*輸出統計報表*/

}

}

}

用C語言編寫“銷售管理系統設計”程序

講下設計思想吧

便條實際上包含了登陸信息了,所以省去了登陸環節,簡單點做到如下幾點就可以 了:

1、調用c的圖形類創建一菜單,有便條錄入、和信息查詢兩欄,信息查詢下面再分各種查詢

2、便條錄入可以都不用圖形界面了,直接按條目輸入值,順序輸入即可

3、保存以文件形式,可以在第一次建立個txt文檔,以製表符分割開來各個字段,但是每次寫入的時候必須按行作為一條數據,可以適當增加需要的字段作為查詢統計方便用(每個製表符分割的為一個字段)。

4、查詢統計就直接檢索這個txt文檔,該加總的求平均的用循環去查即可。

5、結果輸出即把查到的內容在屏幕上打印出來即可。

其他,如果用c++做就簡單多了,沒那麼多代碼寫

c語言編程,銷售員業績管理程序設計

你先湊活着拿去用,很多細節可以強化一下。有空我在弄一下

/************************************************

salesman management mini system 01.07.2016

**************************************************/ 

#include stdio.h

struct mkt

{

int nr;

char name[15];

char prdct[30];

float price;

float pnr;

}info[3];

void input_1(struct mkt*);

void showall_2(struct mkt*);

void showone_3(struct mkt*);

main()

{

int select;

printf(“Welcome to marketing management system!\n”);

printf(“Select a number 1-3 to input”);

while(1)

{

printf(“\n\n1.Data input\n2.Show all data\n3.show one data\n\n”);

scanf(“%d”,select);

switch(select)

case 1: 

input_1((info[0]));break;

case 2: 

showall_2((info[0]));break;

case 3: 

showone_3((info[0]));break;

default: printf(“Invalid, select a number 1-3\n”);

}

}

}

void input_1(struct mkt* p)       

{

int i,j;

printf(“\nInput sequently\n”);

printf(“1.Number\n2.Name\n3.Price\n4.Sold amount\n”);

for (j=0;j3;j++)

{ printf(“\n1.Number:”);

scanf(“%d”,((p+j)-nr));

printf(“\n2.Name:”);

scanf(“%s”,((p+j)-name[0]));

printf(“\n3.Price:”);

scanf(“%d”,((p+j)-price));

  printf(“\n4.Sold amount:”);

scanf(“%d”,((p+j)-pnr));

}

}

void showall_2(struct mkt* p)

{ int i,j;

printf(“number name price amount\n”);

for(i=0;i3;i++)

{

printf(“%d “,((p+i)-nr));

for(j=0;j15;j++) printf(“%c”,((p+i)-name[j]));

printf(“%d “,((p+i)-price));

printf(“%d\n”,((p+i)-pnr));

}

}

void showone_3(struct mkt* p)

{ int j;

printf(“Input the number of salesman:\n\n”);

scanf(“%d”,(p-nr));

printf(“\nnumber name price amount\n”);

printf(“%d “,(p-nr));

for(j=0;j15;j++) printf(“%c”,(p-name[j]));

printf(“%d “,(p-price));

printf(“%d\n”,(p-pnr));

printf(“\n”);

}

c語言 促銷的價格(多分支和簡單循環)

你這樣寫代碼,肯定是輸入一個數,執行完顯示結果在允許你輸入另一個數呀。

建議建立一個數組,一次性把所有數字輸入完,然後再讓程序一併輸出,下面給你改了改main函數。另外最好使用double的浮點數,因為計算機默認是使用double類型,並且即便是int類型的b,遇到浮點數計算時,系統也會自動將其轉化為double,不需要人為添加強制轉換的語句。

int main()

{

int a, i;

double c;

scanf(“%d”, a);

int *b = (int*)malloc(a * sizeof(int));

for (i = 0; i a; i++)

{

scanf(“%d”, b[i]);

}

for (i = 0; i a; i++)

{

if (b[i] = 5000)

c = b[i] * 0.8;

else if (b[i] = 3000)

c = b[i] * 0.85;

else if (b[i] = 2000)

c = b[i] * 0.9;

else if (b[i] = 1000)

c = b[i] * 0.95;

else c = b[i];

printf(“%.1f\n”, c);

}

return 0;

}

C語言做個小型商品銷售管理系統

我這裡有一個!

具體的,稍微改一下就可以了!

#include “stdio.h” /*I/O函數*/

#include “stdlib.h” /*其它說明*/

#include “string.h” /*字符串函數*/

#include “conio.h” /*屏幕操作函數*/

#include “mem.h” /*內存操作函數*/

#include “ctype.h” /*字符操作函數*/

#include “alloc.h” /*動態地址分配函數*/

struct score

{

int mingci;

char xuehao[8];

char mingzi[20];

float score[6];

}data,info[1000];

int i,j,k=0;

char temp[20],ch;

FILE *fp,*fp1;

void shuru()

{

if((fp=fopen(“s_score.txt”,”ab+”))==NULL)

{

printf(“cannot open this file.\n”);

getch();exit(0);

}

for(i=0;i=1000;i++)

{

printf(“\nPlease shuru xuehao:”);

gets(data.xuehao);

printf(“Please shuru mingzi:”);

gets(data.mingzi);

printf(“Please shuru yuwen score:”);

gets(temp);data.score[0]=atof(temp);

printf(“Please shuru shuxue score:”);

gets(temp);data.score[1]=atof(temp);

printf(“Please input yingyu score:”);

gets(temp);data.score[2]=atof(temp);

printf(“Please shuru wuli score:”);

gets(temp);data.score[3]=atof(temp);

printf(“Please shur huaxue score:”);

gets(temp);data.score[4]=atof(temp);

data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];

fwrite(data,sizeof(data),1,fp);

printf(“another?y/n”);

ch=getch();

if(ch==’n’||ch==’N’)

break;

} fclose(fp);

}

void xianshi()

{

float s;int n;

if((fp=fopen(“s_score.txt”,”rb+”))==NULL)

{

printf(“Cannot reading this file.\n”);

exit(0);

}

for(i=0;i=1000;i++)

{

if((fread(info[i],sizeof(info[i]),1,fp))!=1)

break;

}

printf(“\nxuehao mingzi yuwen shuxue yingyu wuli huauxue zhongfen\n”);

for(j=0,k=1;ji;j++,k++)

{

info[j].mingci=k;

printf(“%6s %8s %3.1f %3.1f %3.1f %3.1f %3.1f %3.1f\n”,info[j].xuehao,info[j].mingzi,info[j].score[0],info[j].score[1],info[j].score[2],info[j].score[3],info[j].score[4],

info[j].score[5]);

}

getch();

fclose(fp);

}

void xiugai()

{

if((fp=fopen(“s_score.txt”,”rb+”))==NULL||(fp1=fopen(“temp.txt”,”wb+”))==NULL)

{

printf(“Cannot open this file.\n”);

exit(0);

}

printf(“\nPLease shuru xiugai xuehao:”);

scanf(“%d”,i); getchar();

while((fread(data,sizeof(data),1,fp))==1)

{

j=atoi(data.xuehao);

if(j==i)

{

printf(“xuehao:%s\nmingzi:%s\n”,data.xuehao,data.mingzi);

printf(“Please shuru mingzi:”);

gets(data.mingzi);

printf(“Please shuru yuwen score:”);

gets(temp);data.score[0]=atof(temp);

printf(“Please shuru shuxue score:”);

gets(temp);data.score[1]=atof(temp);

printf(“Please input yingyu score:”);

gets(temp);data.score[2]=atof(temp);

printf(“Please input wuli score:”);

gets(temp);data.score[3]=atof(temp);

printf(“Please input huaxue score:”);

gets(temp);data.score[4]=atof(temp);

data.score[5]=data.score[0]+data.score[1]+data.score[2]+data.score[3]+data.score[4];

} fwrite(data,sizeof(data),1,fp1);

}

fseek(fp,0L,0);

fseek(fp1,0L,0);

while((fread(data,sizeof(data),1,fp1))==1)

{

fwrite(data,sizeof(data),1,fp);

}

fclose(fp);

fclose(fp1);

}

void chazhao()

{

if((fp=fopen(“s_score.txt”,”rb”))==NULL)

{

printf(“\nCannot open this file.\n”);

exit(0);

}

printf(“\nPLease shuru xuehao chakan:”);

scanf(“%d”,i);

while(fread(data,sizeof(data),1,fp)==1)

{

j=atoi(data.xuehao);

if(i==j)

{

printf(“xuehao:%s mingzi:%s\nyuwen:%f\n shuxue:%f\n yingyu:%f\n wuli:%f\n huaxue:%f\n “,data.xuehao,data.mingzi,data.score[0],data.score[1],data.score[2],data.score[3],data.score[4],data.score[5]);

}getch();

}

}

void shanchu()

{

if((fp=fopen(“s_score.txt”,”rb+”))==NULL||(fp1=fopen(“temp.txt”,”wb+”))==NULL)

{

printf(“\nopen score.txt was failed!”);

getch();

exit(0);

}

printf(“\nPlease input ID which you want to del:”);

scanf(“%d”,i);getchar();

while((fread(data,sizeof(data),1,fp))==1)

{

j=atoi(data.xuehao);

if(j==i)

{

printf(“Anykey will delet it.\n”);

getch();

continue;

}

fwrite(data,sizeof(data),1,fp1);

}

fclose(fp);

fclose(fp1);

remove(“s_score.txt”);

rename(“temp.txt”,”s_score.txt”);

printf(“Data delet was succesful!\n”);

printf(“Anykey will return to main.”);

getch();

}

main()

{

while(1)

{

clrscr(); /*清屏幕*/

gotoxy(1,1); /*移動光標*/

textcolor(YELLOW); /*設置文本顯示顏色為黃色*/

textbackground(BLUE); /*設置背景顏色為藍色*/

window(1,1,99,99); /* 製作顯示菜單的窗口,大小根據菜單條數設計*/

clrscr();

printf(“*************welcome to use student manage******************\n”);

printf(“*************************menu********************************\n”);

printf(“* ========================================================= * \n”);

printf(“* 1shuru 2xiugai * \n”);

printf(“* 3shanchu 4chazhao * \n”);

printf(“* 5xianshi 6exit * \n”);

printf(“* * \n”);

printf(“* ——————————————————— * \n”);

printf(” Please input which you want(1-6):”);

ch=getch();

switch(ch)

{

case ‘1’:shuru();break;

case ‘2’:xiugai(); break;

case ‘3’:shanchu(); break;

case ‘4’:chazhao(); break;

case ‘5’:xianshi(); break;

case ‘6’:exit(0);

default: continue;

}

}

}

原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/185333.html

(0)
打賞 微信掃一掃 微信掃一掃 支付寶掃一掃 支付寶掃一掃
小藍的頭像小藍
上一篇 2024-11-26 12:18
下一篇 2024-11-26 12:18

相關推薦

  • AES加密解密算法的C語言實現

    AES(Advanced Encryption Standard)是一種對稱加密算法,可用於對數據進行加密和解密。在本篇文章中,我們將介紹C語言中如何實現AES算法,並對實現過程進…

    編程 2025-04-29
  • 學習Python對學習C語言有幫助嗎?

    Python和C語言是兩種非常受歡迎的編程語言,在程序開發中都扮演着非常重要的角色。那麼,學習Python對學習C語言有幫助嗎?答案是肯定的。在本文中,我們將從多個角度探討Pyth…

    編程 2025-04-29
  • Python被稱為膠水語言

    Python作為一種跨平台的解釋性高級語言,最大的特點是被稱為”膠水語言”。 一、簡單易學 Python的語法簡單易學,更加人性化,這使得它成為了初學者的入…

    編程 2025-04-29
  • OpenJudge答案1.6的C語言實現

    本文將從多個方面詳細闡述OpenJudge答案1.6在C語言中的實現方法,幫助初學者更好地學習和理解。 一、需求概述 OpenJudge答案1.6的要求是,輸入兩個整數a和b,輸出…

    編程 2025-04-29
  • Python按位運算符和C語言

    本文將從多個方面詳細闡述Python按位運算符和C語言的相關內容,並給出相應的代碼示例。 一、概述 Python是一種動態的、面向對象的編程語言,其按位運算符是用於按位操作的運算符…

    編程 2025-04-29
  • Python語言由荷蘭人為中心的全能編程開發工程師

    Python語言是一種高級語言,很多編程開發工程師都喜歡使用Python語言進行開發。Python語言的創始人是荷蘭人Guido van Rossum,他在1989年聖誕節期間開始…

    編程 2025-04-28
  • Python語言設計基礎第2版PDF

    Python語言設計基礎第2版PDF是一本介紹Python編程語言的經典教材。本篇文章將從多個方面對該教材進行詳細的闡述和介紹。 一、基礎知識 本教材中介紹了Python編程語言的…

    編程 2025-04-28
  • Python語言實現人名最多數統計

    本文將從幾個方面詳細介紹Python語言實現人名最多數統計的方法和應用。 一、Python實現人名最多數統計的基礎 1、首先,我們需要了解Python語言的一些基礎知識,如列表、字…

    編程 2025-04-28
  • Python作為中心語言,在編程中取代C語言的優勢和挑戰

    Python一直以其簡單易懂的語法和高效的編碼環境而著名。然而,它最近的發展趨勢表明Python的使用範圍已經從腳本語言擴展到了從Web應用到機器學習等廣泛的開發領域。與此同時,C…

    編程 2025-04-28
  • Python基礎語言

    Python作為一種高級編程語言擁有簡潔優雅的語法。在本文中,我們將從多個方面探究Python基礎語言的特點以及使用技巧。 一、數據類型 Python基礎數據類型包括整數、浮點數、…

    編程 2025-04-28

發表回復

登錄後才能評論