700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > C语言笔记本电脑销售系统课设

C语言笔记本电脑销售系统课设

时间:2021-09-10 23:54:27

相关推荐

C语言笔记本电脑销售系统课设

项目说明

本系统基于C语言开发,适用于刚入门的C语言新手项目课设,开发软件采用VC++6.0开发,VS,DEV C++等均可运行。

项目运行截图

开始界面

代码界面截图

部分关键代码

void CHANGE(struct Computer *head)

{

struct Computer *p;

char ch1[100],ch2[100],ch3[100];

int a,b,flag=0;

float c,d;

FILE *fp;

p = head;

printf("------------------------------------------------------------------------------------------------------------------------\n");

printf(" 请按如下格式输入来修改一条笔记本销售信息:\n\n");

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xF1);

printf(" 产品名称 产品品牌 产品型号 销售数量(修改后)进价(修改后)库存数量(修改后)售价(修改后)\n\n");

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xF0);

printf(" Input: ");

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xFC);

scanf("%s %s %s %d %f %d %f",ch1,ch2,ch3,&a,&c,&b,&d);

printf("\n");

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xF0);

while(p!=NULL)

{

if(strcmp(ch1,p->Name)==0&&strcmp(ch2,p->Brand)==0&&strcmp(ch3,p->Type)==0)

{

flag = 1;

p->Sell_quantity = a;

p->Purchase_price = c;

p->Remain_quantity = b;

p->Sell_price = d;

p->total_money = p->Sell_quantity*p->Sell_price;

}

if(flag==1) break;

p = p->next;

}

if(flag==0) printf(" 未找到该信息!\n");

fp = fopen("SellRecord.txt","wb+");

fclose(fp);

SAVE(head);

}

void HIGH(struct Computer *head)

{

struct Computer *p,temp;

int max;

system("cls");

printf("------------------------------------------------------------------------------------------------------------------------\n");

getchar();

p = head;

max = 0;

while(p!=NULL)

{

if(p->Sell_quantity>max)

{

temp = *p;

max = p->Sell_quantity;

}

p = p->next;

}

p = head;

printf(" 销售最多为");

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xFC);

printf(" %d ",max);

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xF0);

printf("台,品牌型号类型为: \n\n");

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xF1);

while(p!=NULL)

{

if(p->Sell_quantity==max)

printf(" %-16s %-16s %-16s\n\n",p->Name,p->Brand,p->Type);

p = p->next;

}

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),0xF0);

printf("\n");

printf(" 请按回车键继续");

getchar();

MENU();

}

获取完整源码:

链接:/s/1y_Uzn7YC8C3yFkCVtVmCqA

提取码:ufpz

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。