项目说明

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

 

项目运行截图

开始界面

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

 

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

 

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

 

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

 

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

 

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

 

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

 

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

 

 代码界面截图

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();

}

 

获取完整源码:

https://max.book118.com/html/2020/1010/6102100013003005.shtm

https://wenku.baidu.com/view/70b94273e43a580216fc700abb68a98270feacc6

相关文章:

  • 2022-01-24
  • 2021-11-26
  • 2021-06-15
  • 2022-01-23
  • 2022-02-08
  • 2021-05-03
  • 2022-03-02
猜你喜欢
  • 2021-06-20
  • 2021-06-25
  • 2021-07-04
  • 2021-12-26
  • 2021-10-07
  • 2021-05-17
  • 2021-07-19
相关资源
相似解决方案